For e.g.
function showIt():void {
something.visible = true;
}
function init():void {
time1 = flash.utils.getTimer();
showIt();
time2 = flash.utils.getTimer();
}
<mx:st id="something" visible="false"/>
<mx:Button click="init()"/>
In the above code, I want to measure the time taken to display st on screen.
Is it enough to compute time2 – time1?
Or should I put an event handler on render?
Or some other way?
You should try out Grant Skinner’s AS3 Performance Test Harness.
Here’s a simple demo of it in action (from his blog):
In the download he has a class called “RenderTest.as”, which he describes with:
I use it all the time, it’s great.
Hope that helps,
Lance