watchexec/bin/dates.mjs
2023-12-19 11:22:59 +00:00

10 lines
217 B
JavaScript
Executable file

#!/usr/bin/env node
const id = Math.floor(Math.random() * 100);
let n = 0;
const m = 5;
while (n < m) {
n += 1;
console.log(`[${id} : ${n}/${m}] ${new Date}`);
await new Promise(done => setTimeout(done, 2000));
}