Skip to content

Instantly share code, notes, and snippets.

@yonixw
Created Dec 3, 2020
Embed
What would you like to do?
Time nodejs
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const play = (i)=>{if(i==0)return; console.log('\u0007'); setTimeout(play,1000,i-1)}
rl.question("How long (min) ?", function(min) {
setTimeout(play,min*60*1000,10)
rl.close();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment