Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinJVM bytecode for inline functionsSingle-choice MCQ

Consider an `inline fun apply(block: () -> Unit)`. At the bytecode level, what happens to the lambda passed at a call site, and why does that change the cost compared to a non-inline higher-order function?

inline fun measured(block: () -> Unit) { val t = System.nanoTime() block() println(System.nanoTime() - t) }