Last active
March 27, 2021 14:21
-
-
Save alexisljn/403902767346e79c488ad8798617eef0 to your computer and use it in GitHub Desktop.
timeleft from SetTimeout in NodeJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const timeout = setTimeout(() => { | |
console.log("executé après 5 sec") | |
},5000) | |
setTimeout(() => { | |
console.log(Math.ceil((timeout._idleStart + timeout._idleTimeout)/1000 - process.uptime())); | |
}, 3000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment