Expand description
Units of time.
Each unit is defined relative to seconds with a conversion factor. They can be used to conveniently create Period and Frequency structs.
Example
use mag::time::{s, ms, ns};
let a = 22.8 * s; // Period<s>
let b = 50.6 * ms; // Period<ms>
let c = 60.0 / s; // Frequency<s>
let d = 3.1234 / ns; // Frequency<ns>
assert_eq!(a.to_string(), "22.8 s");
assert_eq!(b.to_string(), "50.6 ms");
assert_eq!(c.to_string(), "60 ㎐");
assert_eq!(format!("{:.2}", d), "3.12 ㎓");
Structs
Gigasecond
Kilosecond
Megasecond
Day
Decisecond
Hour
Minute
Millisecond
Nanosecond
Picosecond
Second
Microsecond
Week
Traits
Unit definition for time