Skip to content

Instantly share code, notes, and snippets.

@giltayar
Last active November 15, 2019 13:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giltayar/e36b624d10cbfad361210d1e7ca58d8f to your computer and use it in GitHub Desktop.
Save giltayar/e36b624d10cbfad361210d1e7ca58d8f to your computer and use it in GitHub Desktop.
let i = 0
const start = Date.now()
setInterval(() => console.log(++i, Date.now() - start), 1000)
console.time('bigcalc')
for (let i = 0; i < 10000000000; ++i) {
Math.cos(37863443 * Math.exp(23749374))
}
console.timeEnd('bigcalc')
/** Result:
bigcalc: 11814.690ms
1 11818
2 12820
3 13821
4 14822
5 15824
6 16828
7 17831
8 18833
9 19833
10 20835
11 21838
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment