Closed
Description
What feature would you like to see?
I just saw the release of Firebase PerfMon KTX and would like to propose adding one more function:
inline fun <E> trace(name : String, block: (Trace) -> E): E {
val trace = startTrace(name)
return try {
block(trace)
} finally {
trace.stop()
}
}
I would also like to point out that I found this code on @JvmName 's article Tracking Performance in Kotlin Suspending Functions with Firebase Performance Monitoring. All credits are theirs.
How would you use it?
This allows us to start a trace with a name using:
trace("some-trace") {
// the operations we woud like to trace
}