Created
June 13, 2019 14:49
-
-
Save erezrokah/3fbe380840223a82fde16a16976a0908 to your computer and use it in GitHub Desktop.
Testing Date.now vs Date.parse(new Date().toUTCString())
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 sleep = async seconds => { | |
return new Promise((resolve, reject) => setTimeout(resolve, seconds * 1000)); | |
}; | |
(async () => { | |
for (let i = 0; i < 10; i++) { | |
console.log('-----------------------------'); | |
console.log(Date.now()); | |
console.log(Date.parse(new Date().toUTCString())); | |
console.log('-----------------------------'); | |
await sleep(2.5); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment