From: Duilio J. P. <dp...@fc...> - 2004-09-05 20:19:16
|
> Not sure if select() will work correctly, probably not. select() will work right, but only on Linux :-( I will add this check on future, so usleep we will use select only on Linux systems. > To implement precise usleep() gettimeofday() should be used, imo. gettimeofday() can be used to get time, but the problem is how to wait until the time has elapsed. "Busy waiting" is not a good idea, and is the only option until we will get some other way to go to sleep (VisThread in future?). But select() does this sleep for us, and doesn't consume process CPU cycles. Regards, Duilio. |