[SDL] Why not nanosleep()?

Mattias Engdegård f91-men at nada.kth.se
Tue Apr 4 09:04:09 PDT 2000


>Huh. What's the resolution of the internal Pentium timers? It's gotta be
>better than SDL's current resolution, and if that's really important, we
>could go that route and start doing things that way. I have improved
>resolution timer code for both x86 Pentium machines and Mac PPCs, if anybody
>wants.

The gettimeofday() syscall in Linux (and doubtless other OSes) uses the cycle
counter where available (which is in most modern processors). But having
a high-resolution clock is not the same thing as a high-res timer that
can wakeup and reschedule processes at higher rates. Some effort has been
made, anyway; see http://www.ittc.ukans.edu/utime/ .

It could be useful for giving some cycles to other threads or cooperating
processes though. Has anyone found themselves in a need for this?




More information about the SDL mailing list