Turns a nanosecond time into a human-readable string, like "37 us" or "45 days 08:55:01".
Times the body, and passes the nanosecond time to the report function as a long.
Times the completion of the future, and passes the nanosecond time to the report function as a long.
Times the completion of the future, and passes the nanosecond time to the report function as a formatted time string (including units, e.
Times the completion of the future, and passes the nanosecond time to the report function as a formatted time string (including units, e.g. "372 ns"), generated by calling the pretty method.
Times the completion of the future, then calls pretty on the elapsed time to get a more human-friendly time string, then passes that to the "format" method.
Times the body, and passes the nanosecond time to the report function as a formatted time string (including units, e.
Times the body, and passes the nanosecond time to the report function as a formatted time string (including units, e.g. "372 ns"), generated by calling the pretty method.
Times the body, then calls pretty on the elapsed time to get a more human-friendly time string, then passes that to the "format" method.
Times the body, then calls pretty on the elapsed time to get a more human-friendly time string, then passes that to the "format" method. For example: timePrettyFormat("This operation took %s", log.debug(_)) { Thread.sleep(1000) }
Would log something close to "This operation took 1 s" to the debug logger.
Various utilities for timing & reporting on blocks of code.
Probably Timer.timePrettyFormat is the method you want; it is easy to format the time into a human readable string to log.