Skip to content

Instantly share code, notes, and snippets.

@vegerot
Created January 16, 2020 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vegerot/ddb6c8e19731c72877c509dacdc7d103 to your computer and use it in GitHub Desktop.
Save vegerot/ddb6c8e19731c72877c509dacdc7d103 to your computer and use it in GitHub Desktop.
How do ticks work
#!/usr/bin/env node
// @flow
var start = Date.now();
var timer = setTimeout(() => {
console.log('done');
console.log(Date.now() - start);
}, 1);
var timer2 = setTimeout(() => {
console.log(timer);
console.log(Date.now() - start);
}, 0);
console.log(timer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment