Saturday, July 14, 2012

How to get the time taken by the application to load itself

Hi Friends,

It has been a long time since I posted anything as I was kind of  busy. I am still busy with some project but got time to post some small but useful information. We all know the best practices to reduce the time taken by the SWF to load itself. We can use modules, viewstack (with auto policy), use small sized images (preferably png files), use RSLs etc. But if we want to know whether it has really reduced the time taken to load, how can we find it out?

There is one very simple method for that. We can call the following function on creation complete of application

[Bindable]public var timeTaken:String;


public function showInitTime():void{

    timeTaken = "App startup: " + getTimer() + " ms";


This variable can be bound to some label

<s:Label text="{timeTaken}"/>

which will display the time taken by the SWF to load itself. I have many such goodies which I have been using and will update. I am also planning to share two of my good components MinimizabePopUP (Spark title window with minimize icon created using spark skin) and BottomDock where the pop-up will be minimized and can be restored from theree. So stay tuned and enjoy!!

No comments: