JavaScript 실행 시간 측정
var nStart = new Date().getTime(); //시작시간 체크(단위 ms)
//.......... 처리 로직 ..............
//.......... 처리 로직 ..............
//.......... 처리 로직 ..............
var nEnd = new Date().getTime(); //종료시간 체크(단위 ms)
var nDiff = nEnd - nStart; //두 시간차 계산(단위 ms)
alert(nDiff + "ms");
---------------------------------------------------------------
JavaScript execution time measurement
var nStart = new Date().getTime(); //start time check(Units ms)
//..........Processing logic..............
//..........Processing logic..............
//..........Processing logic..............
var nEnd = new Date().getTime(); //end time check(Units ms)
var nDiff = nEnd - nStart; //time difference between the two calculations (Units ms)
alert(nDiff + "ms");
Warning: The original article is Korean. Can not be viewed by the English.
---------------------------------------------------------------
댓글 없음:
댓글 쓰기