lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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 ... )