I think it would be cool to have a timeIt function, it could help us choose the fastest solutions to other issues.
The signature would be something like this:
- @param {Function} func - the function you want to time
- @param {number} num - the number of times you want to run the function (maybe add a sensible default like 500)
- @return {null} - no return value, instead it just console.logs the average runtime for the function
*/
So we'd use it like this:
timeIt(func, 1000)
and it would log out avg. runtime: 21ms
I think it would be cool to have a timeIt function, it could help us choose the fastest solutions to other issues.
The signature would be something like this:
*/
So we'd use it like this:
timeIt(func, 1000)and it would log out
avg. runtime: 21ms