Created
February 7, 2021 06:32
-
-
Save mr-pascal/ccc4b43137820ef04fea0bc844240177 to your computer and use it in GitHub Desktop.
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
/** | |
* Measures the time in milliseconds it takes for the passed in method to finish | |
* @param {function} fn The method which should be measured | |
* @param {Array<unknown>} args A dynamic amount of parameters which will be passed into 'fn' | |
* @return {Promise<[unknown, number]>} A tuple where the first element is the response of the passed in method and the | |
* second the time in milliseconds it took to complete | |
*/ | |
export declare const measureAsync: <T, G extends unknown[]>(fn: (...args: G) => Promise<T>, ...args: G) => Promise<[T, number]>; | |
/** | |
* Measures the time in milliseconds it takes for the passed in method to finish | |
* @param {function} fn The method which should be measured | |
* @param {Array<unknown>} args A dynamic amount of parameters which will be passed into 'fn' | |
* @return {[unknown, number]} A tuple where the first element is the response of the passed in method and the | |
* second the time in milliseconds it took to complete | |
*/ | |
export declare const measureSync: <T, G extends unknown[]>(fn: (...args: G) => T, ...args: G) => [T, number]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment