5 lines
199 B
JavaScript
5 lines
199 B
JavaScript
// repeat with the interval of 2 seconds
|
|
let timerId = setInterval(() => logger.info('tick'), 2000);
|
|
|
|
// after 5 seconds stop
|
|
setTimeout(() => { clearInterval(timerId); logger.info('stop'); }, 5000); |