[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Sleep miliseconds
- From: Sean Conner <sean@...>
- Date: Tue, 16 Aug 2011 06:04:22 -0400
It was thus said that the Great Lorenzo Donati once stated:
>
> Warning: slighlty OT question.
>
> Out of curiosity, and relating to modern PC architectures, are there
> hardware limits to the availability of an high resolution timer at
> software level, or all this diversity is just a problem of operating
> system or API idiosyncrasies?
It's system dependent. When I wrote my own Lua sleep() function (based
upon nanosleep()), I found that the minimum "sleep quantum" on Solaris to be
0.01 while on Linux, it was more like .0005. I found this out empirically,
but the clock_getres() function (available on Linux and Solaris) confirmed
this (when I found out about the function).
-spc (Ah, the joys of portable code ... )