🎉 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?
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
Popular Topics
Advertisement