Create, Compete & Win at Redbrick Connect 2024! πŸŽ‰

Timer

μ‹œκ°„μ„ μΈ‘μ •ν•˜λŠ” 타이머 κΈ°λŠ₯을 μ œκ³΅ν•˜λŠ” λͺ¨λ“ˆ.

λ©”μ†Œλ“œλ“€

.start()

타이머λ₯Ό μ‹œμž‘ν•˜λŠ” ν•¨μˆ˜.

.pause()

타이머λ₯Ό μ€‘μ§€ν•˜λŠ” ν•¨μˆ˜.

.resume()

정지 μƒνƒœμΈ 타이머λ₯Ό λ‹€μ‹œ μ‹œμž‘ν•˜λŠ” ν•¨μˆ˜.

.reset()

타이머λ₯Ό μ΄ˆκΈ°ν™”ν•˜λŠ” ν•¨μˆ˜.

.getTime()

.getTime() : float

호좜 μ‹œμ˜ 타이머 μ‹œκ°„ 값을 λ°˜ν™˜ν•©λ‹ˆλ‹€. κ°’μ˜ λ‹¨μœ„λŠ” 초(sec)μž…λ‹ˆλ‹€.

Example

const timer = new REDBRICK.Timer();
 
timer.start();
timer.pause();
timer.resume();
timer.reset();
 
const currentTime = timer.getTime();
console.log(currentTime);