AS3 Calculating Delta Time In Seconds

Posted by user1133079 on Game Development See other posts from Game Development or by user1133079
Published on 2012-06-01T20:06:30Z Indexed on 2012/06/01 22:51 UTC
Read the original article Hit count: 220

Filed under:
|
|

Here is how I've been trying to implement delta time based on different internet resources.

var startTime:Number = getTimer();
game.Update(deltaTime);
deltaTime = Number(getTimer() - startTime) * 0.001;

My issue with this is it doesn't seem to be giving me accurate timing. The main update shows the frame time at 0.001 and when reinitializing the level it goes to 0.002. I'm using dt else where for a timer and later on time based physics so I would like it to work as expected. I must be missing something silly.

© Game Development or respective owner

Related posts about engine

Related posts about actionscript-3