Timer Assistance

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.

Timer Assistance

Postby bdpdonp » Wed Jan 04, 2012 6:13 pm

I am attempting to use the timer class, but it seems the timer is not running and a call to start does not seem to help.

The code for the first timer calls:
cpp Code: Select all
       
device->getTimer()->start();
u32 timerStart = device->getTimer()->getTime();
 


and the code when I check the timer again.
cpp Code: Select all
       
u32 timerEnd = device->getTimer()->getTime();
 


Thanks for the assistance
bdpdonp
 
Posts: 52
Joined: Sat Oct 10, 2009 6:35 am

Re: Timer Assistance

Postby hendu » Wed Jan 04, 2012 6:37 pm

getTime is updated only on device->run(). Use getRealTime if you need better granularity than once per frame.
hendu
 
Posts: 1551
Joined: Sat Dec 18, 2010 12:53 pm

Re: Timer Assistance

Postby serengeor » Wed Jan 04, 2012 7:53 pm

I'm sure there is also a tick() function that updates the timer.
Working on game: Marrbles (Currently stopped).
User avatar
serengeor
 
Posts: 1695
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania


Return to Beginners Help

Who is online

Users browsing this forum: No registered users and 1 guest