Skip to main content

drain_timer_commands

Function drain_timer_commands 

Source
pub fn drain_timer_commands(
    events: MessageReader<'_, '_, ScriptCommandEvent>,
    timers: ResMut<'_, TimerRegistry>,
    wake: Option<Res<'_, WakeDeadline>>,
)
Expand description

Read SetTimer / CancelTimer commands emitted by the script’s builtins this tick and update the TimerRegistry accordingly, then ask the loop to wake at the earliest pending deadline. Without that request an idle loop parks on events alone and a timer armed from a click fires only when some unrelated input ticks the app.