Question

I need a high precision time method in microseconds rather than milliseconds for actionscript, unfortunately I couldn't find much help on the web.

I need such control in order to implement the usage of a fixed timestep in transitions as described in this article: http://gafferongames.com/game-physics/fix-your-timestep/, in order to solve my problem described in Optimizing transition/movement smoothness for a 2D flash game

Any suggestions?

Was it helpful?

Solution

This is not possible.

OTHER TIPS

Although not insanely accurate, I believe this has way more time precision than relying on ENTER_FRAME.

public var t:Timer;
public var initialTime:int;

public function setup():void{
    t=new Timer(1000); //in miliseconds
    t.addEventListener(TimerEvent.TIMER, onTimerTick);
    t.start();
    initialTime=getTimer();
}

public function onTimerTick(e:TimerEvent):void{
    trace("elapsed:"+getTimer()-initialTime);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top