| Crates.io | nano_clock |
| lib.rs | nano_clock |
| version | 1.0.0 |
| created_at | 2025-07-20 15:29:52.548839+00 |
| updated_at | 2025-07-20 15:29:52.548839+00 |
| description | Ultra-fast and accurate nanosecond-level timing utilities |
| homepage | |
| repository | https://github.com/TachyonConcepts/NanoClock |
| max_upload_size | |
| id | 1761192 |
| size | 18,585 |
Ultra-fast date/time formatting for HTTP headers and system profiling.
Written in Rust, sprinkled with inline assembly, optimized for the lowest latency possible.
(i32, u8, u8, u8, u8, u8, u8) tuple formatyear, month, day, hour, minute, second, weekday)Date: ... GMT) in preallocated buffersnano_clock_asm) for even lower latencytime() (wall-clock) and clock_gettime(CLOCK_MONOTONIC) for monotonic measurementsString, no chrono, no nonsense.use nano_clock::{nano_clock, nano_http_date};
fn main() {
let (y, m, d, h, min, s, w) = nano_clock();
println!("Now: {y:04}-{m:02}-{d:02} {h:02}:{min:02}:{s:02} (weekday: {w})");
let mut buf = [0u8; 35];
unsafe {
nano_http_date(&mut buf, false);
}
println!("{}", std::str::from_utf8(&buf).unwrap());
}