Timer & FPS

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.
Post Reply
gershon
Posts: 10
Joined: Tue Aug 30, 2005 7:50 pm
Location: Israel

Timer & FPS

Post by gershon »

why is my delta-time constantly changing?

u32 time = timer->getTime()
float dt = (float)( time - time2 )
time2 = time
Guest

Post by Guest »

Because that is what Delta time does. If it was constant all the time there would be no need for it :)

It measures how long the last frame took and returns the result - which can always fluctuate.

However large fluctuations are a sign of something bad in your code, but you didn't post your average results so I don't know how bad they are!?
gershon
Posts: 10
Joined: Tue Aug 30, 2005 7:50 pm
Location: Israel

Post by gershon »

donno what i did exacty, movment was jercky but now it working... :)
at ~200 fps i get values of 1-44.
i use it as:
v = a * (dt/1000)
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post by CZestmyr »

I don't know what is your problem, but physical formulas are clear:
v = a * dt
s = v * dt
with relatively small dt, which is your case, you can use
v = a * t
s = v * t
Post Reply