Last active
February 2, 2017 08:36
-
-
Save hackjutsu/7591a4f49e98c240f8cb7389d4a69a08 to your computer and use it in GitHub Desktop.
The time benchmark in Nodejs #tags: lepton
This file contains hidden or 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
| let startTime = process.hrtime(); | |
| //... | |
| let diff = process.hrtime(startTime); | |
| console.log('benchmark took %d nanoseconds', diff[0] * 1e9 + diff[1]); |
This file contains hidden or 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
| console.time('init') | |
| // Running your code | |
| console.timeEnd('init') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment