measureLoad

inline fun <T> measureLoad(message: String, block: () -> T): T

Measures the amount of time in milliseconds it takes to execute the given block. Example:

measureLoad("Waited for {time}") {
// wait for 100 ms
Thread.sleep(100)
}

Sample console output:

Waited for 100ms

Parameters

message

The message to print. You can use '{time}' to replace with the amount of time in ms

block

The block to execute