I'm using flash remoting and I need a script to measure the code execution time.
I tried using the script below but sometimes the result is negative. (eg -841ms)
Does anybody have a robust code execution timer function?
var t1:Date = new Date();
//Do something
var t2:Date = new Date();
trace(t2.getMilliseconds() - t1.getMilliseconds());
Open in new window
Final solution:
import flash.utils.getTimer;
var t1:uint = getTimer();
//Do something
var t2:uint = getTimer();
var delay:uint= t2 - t1;
trace(delay);