Skip to content

Instantly share code, notes, and snippets.

@ShapeGroup
Created June 19, 2021 20:37
Show Gist options
  • Save ShapeGroup/952b6be07f0a73b88a4d6e1c5d48dd6f to your computer and use it in GitHub Desktop.
Save ShapeGroup/952b6be07f0a73b88a4d6e1c5d48dd6f to your computer and use it in GitHub Desktop.
js-kit-wait
//// JS KIT - WAIT A TIME
//// MIT LICENCE
//// Credit: alberto marà
// how to use:
// wait(3000);
const wait = (ms) => {
let start = new Date().getTime(),
end = start;
while (end < start + ms) {
end = new Date().getTime();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment