==> Regarding [Wlug] getting that cpu to sleep ...; brad <maitre@ccs.neu.edu> adds: maitre> greetings, maitre> I have a question for those linux programmers out there. i'm maitre> writing a program on linux (kubuntu to be specific) that requires maitre> high-precision timing, somewhere on the order of 100 to 1000 micro maitre> seconds. I get very good timing out of a loop written such that a maitre> while() loop checks the system clock after every iteration and maitre> comparing that to the desired wait time, like so (pseudo_code): maitre> while(time_passed < wait_time) { time_passed = get_time() } ... maitre> The problem with this approach is that the process uses 99% of the maitre> CPU since it just spins the CPU until enough time has expired. My The other problem with this is that you can be scheduled if your timeslice runs out. maitre> question: is there a way on linux (in C) to have the CPU sleep or maitre> send it a no-op such that it's not just eating up cycles until time maitre> expires? I have looked at nanosleep and usleep, however they appear maitre> to only have precision to 10ms which too latent for my needs. As Mike pointed out, in more recent kernels you can tune the value of HZ to get better granularity from select/poll. What, precisely, are you trying to do and on what kernel? Perhaps with more information we could provide better guidance. -Jeff