TimeFunction: "perf" | "date" | () => number

the type of time function to use for your Stopwatch instance.

it is best if it returns the time in milliseconds, so that the time scale can be consistient across various uses.

here are the available options:

  • "perf" is equivalent to using the built-in performance.now function. (default)
  • "date" is equivalent to using the built-in Date.now function.
  • alternatively, you could define your own time function.