msec : array[0],dictionary[0]

by 110100110101101
♥0 | Line 31 | Modified 2016-06-13 00:31:36 | MIT License
play

ActionScript3 source code

/**
 * Copyright 110100110101101 ( http://wonderfl.net/user/110100110101101 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/mUMK
 */

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.utils.Dictionary;
    import flash.utils.getTimer;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var memo:TextField = new TextField();
            var text:String = "";
            var time:Number = 0;
            var i:int = 0;
            var iMax:int = 10000000;
            
            var array:Array = [0];
            var dictionary:Dictionary = new Dictionary();
            dictionary[0] = 0;
            
            time = getTimer();
            for(i=0; i<iMax; ++i){
                array[0]
            }
            text += String(getTimer() - time) + " msec : array[0]\n"
            
            time = getTimer();
            for(i=0; i<iMax; ++i){
                dictionary[0]
            }
            text += String(getTimer() - time) + " msec : dictionary[0]\n"
            
            memo.text = text;
            memo.width = 465;
            addChild(memo);
        }
    }
}

Forked