# Time units in std::time

**URL:** <https://internals.rust-lang.org/t/time-units-in-std-time/8024>\
**Category:** libs\
**Created:** [July 21, 2018, 12:54pm UTC](https://internals.rust-lang.org/t/time-units-in-std-time/8024 "2018-07-21T12:54:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Tom-Phinney](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/tom-phinney/32/3299_2.png) [@Tom-Phinney](https://internals.rust-lang.org/u/Tom-Phinney)\
**Post date:** [July 21, 2018, 3:41pm UTC](https://internals.rust-lang.org/t/time-units-in-std-time/8024/3 "2018-07-21T15:41:25Z")

</div>

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

```rust
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.

---

_[View the full topic](https://internals.rust-lang.org/t/time-units-in-std-time/8024)._
