Skip to content

Instantly share code, notes, and snippets.

@hackjutsu
Last active February 2, 2017 08:36
Show Gist options
  • Select an option

  • Save hackjutsu/7591a4f49e98c240f8cb7389d4a69a08 to your computer and use it in GitHub Desktop.

Select an option

Save hackjutsu/7591a4f49e98c240f8cb7389d4a69a08 to your computer and use it in GitHub Desktop.
The time benchmark in Nodejs #tags: lepton
let startTime = process.hrtime();
//...
let diff = process.hrtime(startTime);
console.log('benchmark took %d nanoseconds', diff[0] * 1e9 + diff[1]);
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