Sign in to follow this  

timer system

This topic is 1990 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What features do you look for in a "timer system"?

If you're using a compiler that supports C++11, then take a look at [tt][url=http://en.cppreference.com/w/cpp/chrono/high_resolution_clock]std::chrono::high_resolution_clock[/url][/tt]: High resolution precision, and cross-platform. If your compiler doesn't support C++11, then you might consider using boost's version of [tt]std::chrono[/tt], [tt][url=http://www.boost.org/doc/libs/1_47_0/doc/html/chrono.html]boost::chrono[/url][/tt].

If none of these are viable options, then you'll be stuck writing platform-specific code. In win32, it's [url=http://msdn.microsoft.com/en-us/library/windows/desktop/ms644904%28v=vs.85%29.aspx]QueryPerformanceCounter[/url], QueryPerformanceFrequency, timeGetTime, GetTickCount, and etc. In a POSIX system, it's apparently [url=http://stackoverflow.com/questions/538609/high-resolution-timer-with-c-and-linux]clock_gettime[/url].

Share this post


Link to post
Share on other sites

This topic is 1990 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this