Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sleep(1) too slow
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00916333
Message ID:
00916842
Views:
7
>Thanks Paul but tried them already, SleepEx(1,1) takes a minimum of 15ms while SleepEx(0,1) takes no time at all and therefore causes 100% cpu.
>
Nick,

You have to remember that Win32 is a pre-emptive operating system. This means that Windows decides how much time each thread gets. IOW, Windows is the dog, your application is the tail, and the tail wags only when the dog says so. You simply can't get the degree of granularity you seem to need. The amount of time Sleep(1) or Sleep(0) will vary from computer to computer depending on everything from clock speed to number of threads running.

If you don't mind my making a suggestion, could you tell us in detail what and why you're trying to accomplish this.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform