Time units in std::time

Why not add an si!() macro that permits specifying a constant duration, or simply an SI unit? E.g.,

let observation_interval: duration = si!(3 da 6 hr 19.05 s 273 ns);
let timeout: duration = si!(1500 us);
CONST SI_US: duration = si!(µs);

Since the underlying representation is UTF-8, both 1500 us and 1500 µs can be acceptable. A future RFC could include SI scaling units if that proved desirable (though personally I’d rather not see 1.5 kius as a way of writing 1536 µs).

Edit: Added example of an isolated unit.

2 Likes