doSynced

fun <R> doSynced(what: () -> R): R

Executes the given block of code in a synchronized across all threads manner. It also measures the time taken to execute the block and updates the total and maximum time worked for.

Return

The result of the block of code.

Parameters

what

The block of code to be executed.