Get the current `Instant` by reading `ClockParameters`
(&self)
| 24 | impl<T: ReadTsc> Clock<Utc> for ClockBound<T> { |
| 25 | /// Get the current `Instant` by reading `ClockParameters` |
| 26 | fn get_time(&self) -> Instant { |
| 27 | let current_tsc = TscCount::new(self.read_tsc.read_tsc().into()); |
| 28 | // TODO: disregarding overflow of TSC, that will take a while, but worth thinking of |
| 29 | self.clock_parameters.time |
| 30 | + ((current_tsc - self.clock_parameters.tsc_count) * self.clock_parameters.period) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | /// Wrapper around `CLOCK_REALTIME` reads, which provides a UTC timestamp. |