Skip to main content

context_switches

Function context_switches 

Source
pub fn context_switches() -> usize
Expand description

The number of context switches that happened so far in the current Shuttle execution.

Note that this is the number of possible context switches, i.e., including times when the scheduler decided to continue with the same task. This means the result can be used as a timestamp for atomic actions during an execution.

Panics if called outside of a Shuttle execution.