SplitScript reference / timer / currentSplitIndex

timer.currentSplitIndex

Function

timer.currentSplitIndex() -> u64?

Returns the index of the split the current attempt is on.

None means that no attempt is in progress. The signed host ABI uses a negative value for that state; all nonnegative values are exposed as u64. The index equals the segment count after the final split. An increased index means that the timer advanced, including through a skip. If an undo and another split both happen between updates, the unchanged index cannot reveal that sequence; an exact timer-event API would require additional host support.

Effects: allocates, reads timer state

Runtime behavior: available everywhere; synchronous

Examples

Observe timer advancement

let splitIndex = timer.currentSplitIndex() else return