zcash-android-wallet-sdk / cash.z.wallet.sdk.ext / twigTask

twigTask

inline fun <R> twigTask(logMessage: String, block: () -> R): R

Meticulously times a tiny task.

inline fun <R> Twig.twigTask(logMessage: String, block: () -> R): R

A tiny log task. Execute the block of code with some twigging around the outside. For silent twigs, this adds a small amount of overhead at the call site but still avoids logging.

note: being an extension function (i.e. static rather than a member of the Twig interface) allows this function to be inlined and simplifies its use with suspend functions (otherwise the function and its "block" param would have to suspend)