Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.events.Event;
- import flash.utils.getTimer;
- import flash.display.Sprite;
- var av:Vector.<Sprite> = new <Sprite>[this, this, this,this];
- var bv:Vector.<Sprite> = new <Sprite>[];
- var aa:Array = [this, this, this,this];
- var ba:Array = [];
- for (var i=0; i < 1E7; i++) {
- ba.push(this);
- bv.push(this);
- }
- var index:int = 2;
- super.addEventListener(Event.ENTER_FRAME, test);
- function test(e:Event):void {
- var t1:int = getTimer();
- aa.splice(index, 2, aa[index + 1], aa[index]);
- var t2:int = getTimer();
- ba.splice(index, 2, ba[index + 1], ba[index]);
- trace(t2-t1, getTimer()-t2);
- t1 = getTimer();
- av.splice(index, 2, av[index + 1], av[index]);
- t2 = getTimer();
- bv.splice(index, 2, bv[index + 1], bv[index]);
- trace(t2-t1, getTimer()-t2);
- trace('-');
- }
- /**
- 0 6
- 0 0
- -
- 0 6
- 0 0
- -
- 0 6
- 0 0
- -
- 0 7
- 0 0
- -
- 0 6
- 0 0
- -
- 0 7
- 0 0
- -
- 0 7
- 0 0
- -
- 0 6
- 0 0
- -
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement