Skip to content

add timeIt function #14

@johnptmcdonald

Description

@johnptmcdonald

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions