sussy-util
Version:
Util package made by me
16 lines (15 loc) • 577 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Measures the execution time of the provided function and logs the result to the console using the given label.
*
* @param {string} label - The label to use when logging the execution time.
* @param {Function} func - The function to measure the execution time of.
* @param {...any} params - The parameters to pass to the function.
* @returns {void}
*/
exports.default = (label, func, ...params) => {
console.time(label);
func.bind(this, ...params);
console.timeEnd(label);
};