Hi there im wondering how to use a time delay in my code. What i have done is searched through a saved file and picked out infomation the send it to the rs232 port. what i want to do is create a time delay of 100 micro seconds for every 18 charecters sent. Heres my code so far.
ontrix 0 Newbie Poster
Recommended Answers
Jump to PostIm using windows xp home and visual C++
Your compiler's documentation is the best place to look for compiler-specific functions. It takes me forever to attempt to navigate the MSDN, so here's a start.
http://msdn.microsoft.com/visualc/reference/default.aspx
Jump to Posthint: look for function Sleep() which uses milliseconds. And 100 is about as accurate as it can get, depending on what other processes are running on the computer.
Jump to PostMS-Windows is not a real-time operating system, so you can't get any better accuracy then a couple hundred milliseconds. If you want microseconds, then you have to use a different real-time os. One reason is that it takes the os thread scheduler a few milliseconds just to switch threads and …
All 10 Replies
Salem 5,265 Posting Sage
ontrix 0 Newbie Poster
Dave Sinkula 2,398 long time no c Team Colleague
ontrix 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
ontrix 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Salem 5,265 Posting Sage
slippygod 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.