Advertisement

timer?

Started by December 26, 1999 02:37 PM
0 comments, last by mikael_j 24 years, 9 months ago
Is there some kind of function in svgalib or c/c++ that works like sleep, but more precise? (sleep is pretty useless since it is limited to whole seconds)
The accepted solution to a high resolution timer is to use the select system call.

int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);

The last value is a timeout that is measured in sub seconds. When the value runs out, it returns.

This solution is also fairly portable to other unix platforms.

-Mike

This topic is closed to new replies.

Advertisement