[15/11/23] Slight rejig to ensure results are consistent

This commit is contained in:
Andrew Conlin 2023-11-15 11:00:30 +00:00
parent 96d8b0a7e2
commit 1631868a5f
2 changed files with 6 additions and 7 deletions

View File

@ -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

View File

@ -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;
}
}