🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

timer?

Started by
0 comments, last by mikael_j 24 years, 6 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)
Advertisement
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