measure
public static LuaExecutionBudget.Measurement<T> measure<T>(Supplier<T> call, long maxCpuNanos, long maxInstructions)
Runs source initialization and its hook under one existing VM watchdog. The caller may pass the remaining allowance of a cross-provider batch. Nested engine calls share it. Elapsed usage is charged at least at one fifth, matching the existing fallback allowance. This also bounds clocks whose CPU resolution is coarser than an individual invocation.
Another host's callback can synchronously cause a measured invocation, for example when a Mind tick's attack fires a damage event that evaluates an enchantment query. The measured invocation then runs in its own frame, and its time is not charged to the interrupted frame. A measured invocation can still not reenter itself.