$ clocksource
v1.0.1Library for times and durations with fixed-size representations
Latest Update Summary
Crate
Name: clocksource New version: 1.0.0 Release date: 2026-03-20T22:13:04.991276Z
Crate readme
Short description A Rust library for time and duration types with fixed-size representations.
Long description The clocksource library provides coarse (second-resolution) and precise (nanosecond-resolution) variants, plus atomic versions for concurrent use. All types use a single 32-bit or 64-bit integer internally, making them compact and efficient for arithmetic operations.
Features • coarse (second-resolution) and precise (nanosecond-resolution) variants • atomic versions for concurrent use • compact internal representation with 32-bit or 64-bit integers
Code Examples Add to Cargo.toml
cargo add clocksource
Basic usage
use clocksource::coarse;
use clocksource::precise;
let coarse_start = coarse::Instant::now();
let coarse_elapsed: coarse::Duration = coarse_start.elapsed();
println!("elapsed: {} seconds", coarse_elapsed.as_secs());
let precise_start = precise::Instant::now();
let precise_elapsed: precise::Duration = precise_start.elapsed();
println!("elapsed: {} ns", precise_elapsed.as_nanos());
let now = precise::UnixInstant::now();
let coarse_now = coarse::UnixInstant::now();
Links • https://docs.rs/clocksource • https://crates.io/crates/clocksource • https://github.com/iopsystems/clocksource
https://api.github.com/repos/iopsystems/clocksource/releases/299619301
Release info
Release version:
Release description
Code Examples
Patch update: 1.0.0 → 1.0.1
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add clocksourceOr add to Cargo.toml: clocksource = "1.0.1"