runtime.profile()
Reports and optionally toggles execution profiling.
Signature
runtime.profile([enabled])
Parameters
Boolean when supplied, otherwise leaves profiling state as-is.
Returns
Dictionary with enabled, instructions, native_entries, jit_compilations, jit_entries, aot_entries, native_instructions, runtime_steps.
Behavior
Enabling from disabled resets counters except the cumulative JIT compilation count.
Errors
Invalid argument or report allocation failure.
Example
use runtime
runtime.profile(true)
for i in 0..5:
pass
assert(runtime.profile().instructions > 0)