Skip to content

Instantly share code, notes, and snippets.

@zmnv
Created December 29, 2018 16:50
Show Gist options
  • Save zmnv/38acb1c18d09538622fbbe436b959a47 to your computer and use it in GitHub Desktop.
Save zmnv/38acb1c18d09538622fbbe436b959a47 to your computer and use it in GitHub Desktop.
Sync waiting time
function sleep(milliseconds) {
const initiation = new Date().getTime();
while ((new Date().getTime() - initiation) < milliseconds);
}
module.exports = sleep;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment