Every line of '90 seconds timer' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
175 function startTimer(secs){ 176 timeInSecs = parseInt(secs)-1; 177 ticker = setInterval("tick()",1000); // every second 178 }
84 setSecondsTimer() { 85 this.secondsTimer = setInterval(() => { 86 setSeconds(getSeconds() - 1) 87 this.checkPoint() 88 }, 1000) 89 }
131 (function timer() { 132 diff = that.duration - Math.floor((Date.now() - start) / 1000); 133 134 if (diff > 0) { 135 that.timeoutId = setTimeout(timer, that.granularity); 136 that.tick(diff); 137 } else { 138 that.running = false; 139 that.tick(0); 140 that.expire(); 141 } 142 }());
61 private startTimer() { 62 this.el.classList.remove(`stopped`) 63 this.startTime = Date.now() 64 this.timerInterval = window.setInterval(() => { 65 const timeLeft = this.timeLeftMilliseconds() 66 if (timeLeft <= 0) { 67 this.stopTimer() 68 this.notifyCompletion() 69 } else { 70 this.displayTimeLeft(formattedTimeSeconds(timeLeft)) 71 } 72 }, updateIntervalMs) 73 }
36 private startTimer() { 37 this.el.classList.remove(`stopped`) 38 this.startTime = Date.now() 39 this.timerInterval = window.setInterval(() => { 40 const timeLeft = this.timeLeftMilliseconds() 41 if (timeLeft <= 0) { 42 this.stopTimer() 43 this.notifyCompletion() 44 } else { 45 this.displayTimeLeft(formattedTimeSeconds(timeLeft)) 46 } 47 }, updateInterval) 48 }
18 function setTimer(timer, callback, interval) { 19 timers[timer.id] = { 20 callback, 21 interval, 22 lastRun: gameTime 23 }; 24 }
33 _setTimeout(callback, time) { 34 this._timer = setTimeout(() => { 35 callback() 36 this._finish = true 37 this._rest = null 38 }, time / this._rate) 39 40 this._finish = false 41 this._time = time 42 this._startTime = new Date() 43 this._callback = callback 44 this._rest = null 45 }
10 function createTimer(msec) { 11 const queue = []; 12 const timer = setInterval(() => { 13 while (0 < queue.length) { 14 const cb = queue.shift(); 15 cb(); 16 } 17 }, msec); 18 19 const producer = () => { 20 return new Promise((resolve, reject) => { 21 queue.push(resolve); 22 }); 23 }; 24 25 producer.clear = () => { 26 clearInterval(timer); 27 }; 28 29 return producer; 30 }
125 export async function timer(delayMs: number): Promise { 126 const start = Date.now(); 127 await sleep(delayMs); 128 const end = Date.now(); 129 return { start, end }; 130 }
6 function countdownTick(ms) { 7 if (ms < 0) return; 8 console.log('sleep', ms); 9 setTimeout(() => countdownTick(ms - 1000), 1000); 10 }