[15/11/23] Slight rejig to ensure results are consistent
This commit is contained in:
parent
96d8b0a7e2
commit
1631868a5f
@ -3,5 +3,4 @@ charset-normalizer==3.3.2
|
||||
idna==3.4
|
||||
maturin==1.3.1
|
||||
requests==2.31.0
|
||||
tictoc @ file:///tmp/.tmpwOgIyC/tictoc-0.1.0-cp311-cp311-linux_x86_64.whl
|
||||
urllib3==2.0.7
|
||||
|
12
src/lib.rs
12
src/lib.rs
@ -42,13 +42,13 @@ impl Init {
|
||||
}
|
||||
|
||||
fn toc(&mut self) {
|
||||
let res = Results {
|
||||
nanos: self.time.elapsed().as_nanos(),
|
||||
micros: self.time.elapsed().as_micros(),
|
||||
millis: self.time.elapsed().as_millis(),
|
||||
seconds: self.time.elapsed().as_secs_f64(),
|
||||
let elapsed_time = self.time.elapsed();
|
||||
self.results = Results {
|
||||
nanos: elapsed_time.as_nanos(),
|
||||
micros: elapsed_time.as_micros(),
|
||||
millis: elapsed_time.as_millis(),
|
||||
seconds: elapsed_time.as_secs_f64(),
|
||||
};
|
||||
self.results = res;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user