Here's the hardware-side impl I have. AN important part is calculating `ns_per_tick` based on timer properties (like auto reload and prescaler for STM) ```rust /// Get the time elapsed since the start of the timer, taking overflow wraps into account. /// /// Important: the value returned here will only be correct if the ARR and PSC are set /// only using the constructor, `set_freq`, or `set_period` methods; if the timer /// doesn't expire prior to calling this, rel to the time being measured (or if it expires, /// the ISR manually updates the wrap count), if system clock time is changed, if the timer /// is stopped, started etc, or if low power modes are entered. pub fn elapsed(&mut self) -> Instant { // let wrap_count = self.wrap_count; let wrap_count = TICK_OVERFLOW_COUNT.load(Ordering::Acquire) as u64; let count_ns = ((self.read_count() as u64 + wrap_count as u64 * self.get_max_duty() as u64) as i128 * self.ns_per_tick as i128); Instant::new(count_ns) } ```