John said:
(The other) John seems happy, but your solution will drive CPU usage up to
100% (it does on Windows anyway), just so the program can do nothing.
Personally, I would much prefer a platform specific solution that actually
puts the thread to sleep.
I can't remember all the details, but I beleive that you can set an
"alarm" (look in the signals documentationon your Unix implementation).
Also, there is nanosleep. All you have to do is convert your time to
the appropriate nanosleep compatible time structure, and you will sleep
for that amount of nanoseconds.
JLR