diff --git a/requirements.txt b/requirements.txt index b4ae2f8..2b076d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/src/lib.rs b/src/lib.rs index 0ab0ca0..d3cf904 100644 --- a/src/lib.rs +++ b/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; } }