FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

JavaScriptCrash-Making/_initial/00_utils at main · pagers-org/JavaScriptCrash-Making · GitHub

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

유틸 함수 사용법

TimerUtils.js

  • 모듈 import

    const TimerUtils = require('상대경로/TimerUtils.js');
  • checkTimer : Date 객체 사용

    let timer = TimerUtils.checkTimer('테스트 명');
    timer.start();
    
    // 측정할 함수 기입
    
    timer.stop();
    • 예제
      const TimerUtils = require('../../_initial/00_utils/TimerUtils.js');
      let timer = TimerUtils.checkTimer('스택 시간 테스트');
      let str = ''
      timer.start();
      for (let i = 0; i < 10000000; i++) {
        str += i;
      }
      timer.stop();
  • checkTimerFunction : console.time 함수 사용

    TimerUtils.checkTimerFunction('측정할 함수명');
    • 예제
      const TimerUtils = require('../../_initial/00_utils/TimerUtils.js');
      TimerUtils.checkTimerFunction(() => {
        let str = ''
        for (let i = 0; i < 10000000; i++) {
          str += i;
        }
      });


Back | FazBrowse Home | New Git URL