Skip to content

Commit 57261f5

Browse files
committed
fix: change timers from process time to thread time
1 parent 27f1000 commit 57261f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,16 @@ pub use timer::Timer;
112112
mod timer {
113113
/// A timer to measure execution time.
114114
///
115-
/// On `unix`/`windows` systems, this is based on `cpu_time::ProcessTime`, on `wasm` systems, it is
115+
/// On `unix`/`windows` systems, this is based on `cpu_time::ThreadTime`, on `wasm` systems, it is
116116
/// based on `std::time::Instant`.
117117
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
118-
pub struct Timer(cpu_time::ProcessTime);
118+
pub struct Timer(cpu_time::ThreadTime);
119119

120120
impl Timer {
121121
/// Gets the current time
122122
#[must_use]
123123
pub fn now() -> Self {
124-
Timer(cpu_time::ProcessTime::now())
124+
Timer(cpu_time::ThreadTime::now())
125125
}
126126

127127
/// Gets the amount of time elapsed since the timer was initialized
@@ -136,7 +136,7 @@ mod timer {
136136
mod timer {
137137
/// A timer to measure execution time.
138138
///
139-
/// On `unix`/`windows` systems, this is based on `cpu_time::ProcessTime`, on `wasm` systems, it is
139+
/// On `unix`/`windows` systems, this is based on `cpu_time::ThreadTime`, on `wasm` systems, it is
140140
/// based on `std::time::Instant`.
141141
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
142142
pub struct Timer(std::time::Instant);

0 commit comments

Comments
 (0)