duration<T>(valueToMeasure: () -> T): DurationMeasurement<T>
Executes the input function and returns an object with execution time in milliseconds and result of that function.
Example
This example passes a wait function (defined in the header), which returns
the execution time and result of that function in a DurationMeasurement
object.