Page 1 of 1

Setting up a timer

Posted: Mon May 17, 2004 1:19 am
by Vixe
Hiyas, I am new to this engine and not a very good programmer :oops:

I am trying to settingup a timer, and my code looks like

irr::Itimer* timer = device->getTimer();

u32 now = timer->getTime();

However, it would give me the ememory violation error. on the second line.
it seems like the Itimer is not a class?
I guess it's more like a programming problem.

could anyone teach me how to set this right and to use the getTime() function?

thanks alot :wink:

Posted: Tue May 18, 2004 6:10 am
by c_olin3404
I just did something like this:

Code: Select all


u32 lastTime = device->getTime();

if(device->getTime() > lastTime + 1000) //if one second has past
    doWateva();