invoke timebase callback, persists state but doesn't seem to do anything

This commit is contained in:
🪞👃🪞 2024-12-29 00:52:20 +01:00
parent ae69e87dc9
commit 003329aa1b
10 changed files with 350 additions and 329 deletions

15
src/time/microsecond.rs Normal file
View file

@ -0,0 +1,15 @@
use crate::*;
/// Timestamp in microseconds
#[derive(Debug, Default)] pub struct Microsecond(AtomicF64);
impl_time_unit!(Microsecond);
impl Microsecond {
#[inline] pub fn format_msu (&self) -> String {
let usecs = self.get() as usize;
let (seconds, msecs) = (usecs / 1000000, usecs / 1000 % 1000);
let (minutes, seconds) = (seconds / 60, seconds % 60);
format!("{minutes}:{seconds:02}:{msecs:03}")
}
}