Skip to content

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;
        }
      });