Created
February 17, 2021 08:05
-
-
Save vipulwairagade/9939ae82513d92c8e339ef58c1dea0e5 to your computer and use it in GitHub Desktop.
Find time required for a particular process in node.js
This file contains 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
const { PerformanceObserver, performance } = require('perf_hooks'); | |
let t0 = performance.now() | |
/* | |
* Do process here for which you need to calculate time | |
* Example : | |
* let response = await axios.get() | |
**/ | |
let t1 = performance.now() | |
console.log("Process time " + (t1 - t0) + " milliseconds.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment