import { setTimeout } from 'node:timers/promises'

const fn = async () => {
    await setTimeout(1000)
    console.log(`Tick ${Date.now()}`);
}

while (true) {
    await fn()
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.