zeed
    Preparing search index...

    Function duration

    • Create a simple duration reporter.

      Returns a function that, when called, reports the elapsed time since duration() was called. The returned string is formatted via formatMilliseconds.

      Example: const t = duration(); // do work...; console.log(t());

      Returns () => string

      a zero-argument function that returns the elapsed time string