Sign in to follow this  

timer system

Recommended Posts

i'm searching for an efficent timer system for using it in a opengl graphics application.
There is something already done?or open source?
I'm using c++.

Share this post

Link to post
Share on other sites
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=]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=]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=]QueryPerformanceCounter[/url], QueryPerformanceFrequency, timeGetTime, GetTickCount, and etc. In a POSIX system, it's apparently [url=]clock_gettime[/url].

Share this post

Link to post
Share on other sites

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