2020-10-10 13:56:55 +01:00

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