4k views
Milliseconds timer using flash.utils.getTimer
This an easy and precise way to know how many milliseconds have passed since some point in your program.
First, you need to use the getTimer() function to save how many milliseconds have passed since the Flash Player started:
ActionScript 3
- startTime_ = flash.utils.getTimer(); // Milliseconds since flash player started
Then, whenever you need to know how many milliseconds have passed, simply subtract getTimer() minus startTime_:
ActionScript 3
- millisecondsElapsed = flash.utils.getTimer() - startTime_;
Submitted by miguelSantirso about 1 year ago — last modified less than a minute ago