t2t-clock
The clocks of t2t: the operating system's wall, monotonic, boot and
CPU-time clocks, read with clock_gettime on Linux and macOS; the CPU's own
counter, read in one instruction on aarch64 and x86_64; and clocks set and
moved by hand, for tests and replays. Each answers one verb, now, with a value
of t2t-core whose type names its timeline. t2t holds both.
Install
t2t-clock builds with Rust 1.98 or later. The operating system's clocks need
std, on 64-bit Linux or macOS; the CPU's counter and the manual clocks build
without it.
Quick Start
use ;
use ;
/// Whether the sample stamped at `stamp` is older than a second.
Features
| Feature | Adds |
|---|---|
std |
the OS clocks, and an x86_64 counter's measured rate |
None is on by default.
Documentation
- The book: which clock to choose, and what each costs.
- The API on docs.rs, with an example for each clock.
- CHANGELOG.md: what changed in each release.
License
Either the MIT License or the Apache License, Version 2.0, at your option.