Any good timers?
-
- Competition winner
- Posts: 523
- Joined: Tue Jan 15, 2013 6:36 pm
Any good timers?
My project is a screensaver and I need a good method for retrieving if a certain amount of time has passed, windows requires this for the screensaver to close. I'm sure this community already has one so I'd save some time by asking the simplest efficient way of doing this.
-
- Posts: 37
- Joined: Fri Nov 04, 2011 12:15 am
Re: Any good timers?
Irrlicht's device has a timer built into it. just do . It keeps track of how many milliseconds have passed since the program opened, and can be stopped and started.
Code: Select all
irrlichtdevice->getTimer();
Re: Any good timers?
On Windows you probably need to enable the high-resolution timer.
Re: Any good timers?
I myself always use native c++ "chrono" namespace timers. There are several types of them so I think you should find what you're looking among them.
Just google "c++ chrono"
Just google "c++ chrono"
Re: Any good timers?
there's the window performance counter functions
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Re: Any good timers?
all that high precision and perf counters are overkill, seriously. irrlicht uses GetTickCount() under the hood when not using high performance timer. GetTickCount() has 15ms resolution. That is plenty for just about anything.
Re: Any good timers?
You only have to *enable* the high-performance timer and GetTickCount will have millisecond accuracy. You don't have to *use* the HP timer.