Created
October 9, 2018 15:50
-
-
Save emyann/3df9e07ab2cf05a0dcb78901a27b0bfa to your computer and use it in GitHub Desktop.
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
function monitoredScope(fn: Function, ...args: any[]) { | |
const startTime = performance.now(); | |
const result = fn.call(this, ...args); | |
const endTime = performance.now(); | |
const elapsedTime = Math.round((endTime - startTime) * 1000) / 1000; | |
return { data: result, infos: { startTime, endTime, elapsedTime } }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment