[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
|
idna==3.4
|
||||||
maturin==1.3.1
|
maturin==1.3.1
|
||||||
requests==2.31.0
|
requests==2.31.0
|
||||||
tictoc @ file:///tmp/.tmpwOgIyC/tictoc-0.1.0-cp311-cp311-linux_x86_64.whl
|
|
||||||
urllib3==2.0.7
|
urllib3==2.0.7
|
||||||
|
12
src/lib.rs
12
src/lib.rs
@ -42,13 +42,13 @@ impl Init {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn toc(&mut self) {
|
fn toc(&mut self) {
|
||||||
let res = Results {
|
let elapsed_time = self.time.elapsed();
|
||||||
nanos: self.time.elapsed().as_nanos(),
|
self.results = Results {
|
||||||
micros: self.time.elapsed().as_micros(),
|
nanos: elapsed_time.as_nanos(),
|
||||||
millis: self.time.elapsed().as_millis(),
|
micros: elapsed_time.as_micros(),
|
||||||
seconds: self.time.elapsed().as_secs_f64(),
|
millis: elapsed_time.as_millis(),
|
||||||
|
seconds: elapsed_time.as_secs_f64(),
|
||||||
};
|
};
|
||||||
self.results = res;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user