import flash.utils.Dictionary; var TOTAL_NUM:int = 10000000; var i:int; var arr:Array = []; for(i=0; i<TOTAL_NUM; ++i){ arr.push(i); } var dic:Dictionary = new Dictionary; for(i=0; i<TOTAL_NUM; ++i){ dic[i] = i; } //배열로 검색 function findArray(index:int):void{ var result_num:int; for(i=0; i<TOTAL_NUM; ++i){ if(arr[i] == index){ result_num = arr[i]; break; } } } //Dictionary로 검색 function findDic(index:int):void{ var result_num:int = dic[index]; } var num:int = getTimer(); this.findArray(TOTAL_NUM - 1); trace("array timer : " + (getTimer() - num)); var num2:int = getTimer(); this.findDic(TOTAL_NUM - 1); trace("dic timer : " + (getTimer() - num2)); //array timer : 236 //dic timer : 2 공유하기 게시글 관리 개발자 향기 저작자표시