Is there a way to get better timing resolution on UNIX OS
Sleep has 1 second resolution. I've heard about using select. Any details
Thanks
Rick
Is there a way to get better timing resolution on UNIX OS
Sleep has 1 second resolution. I've heard about using select. Any details
Thanks
Rick
Rickey> Is there a way to get better timing resolution on UNIX OS
Rickey> Sleep has 1 second resolution. I've heard about using
Rickey> select. Any details
See the FAQ.
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>
> Sleep has 1 second resolution. I've heard about using select. Any details
Use select() with NULL-Pointers for rfds,wfds,xfds, and specify the desired
time
in the timeval-structure (last parameter).
Remark: This works in a similar way for poll().
See also: Some systems have the usleep() call.
Regards Rainer
Here's a simple implementation of usleep() using select()
void usleep (unsigned int useconds)
{
struct timeval delay;
delay.tv_sec = 0;
delay.tv_usec = useconds;
select (0, NULL, NULL, NULL, &delay);
--Quote:}
> Is there a way to get better timing resolution on UNIX OS
> Sleep has 1 second resolution. I've heard about using select. Any details
Just do a "man select" and all your questions will be answered ;-)
> Thanks
> Rick
: >
: > Is there a way to get better timing resolution on UNIX OS
How about usleep()?
--
Ben
"You have your mind on computers, it seems."
1. I need an funcion like time() but having about milisecond resolution
TIA
Mateusz M. Korniak
3. Is there a time() with millisecond or better resolution?
5. Q: timing a function w/ sub-second resolution
7. Run time measurement with micro (or at least milli)-second resolution help please
8. Installed linux mandrake 7.1 does not reconize hardware
9. Changing screen resolution AND virtual resolution?
10. resolution on console and resolution in X?
11. resolution! what resolution?
12. Why is high resolution sleep inaccurate in realtime mode?
13. How to sleep a kernel process with high timer resolution??