Skip to content

Commit bdc0f54

Browse files
committed
Add segment_splitted
1 parent 832cbec commit bdc0f54

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/runtime/sys.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ extern "C" {
8585
/// finished, but has not been reset. So you need to be careful when using
8686
/// this value for indexing.
8787
pub fn timer_current_split_index() -> i32;
88+
/// Whether the segment at `idx` was splitted this attempt.
89+
pub fn timer_segment_splitted(idx: i32) -> bool;
8890
/// Sets a custom key value pair. This may be arbitrary information that the
8991
/// auto splitter wants to provide for visualization. The pointers need to
9092
/// point to valid UTF-8 encoded text with the respective given length.

src/runtime/timer.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ pub fn current_split_index() -> i32 {
121121
unsafe { sys::timer_current_split_index() }
122122
}
123123

124+
/// Whether the segment at `idx` was splitted this attempt.
125+
pub fn segment_splitted(idx: i32) -> bool {
126+
unsafe { sys::timer_segment_splitted(idx) }
127+
}
128+
124129
/// Sets the game time.
125130
#[inline]
126131
pub fn set_game_time(time: time::Duration) {

0 commit comments

Comments
 (0)