nano_clock 1.0.0

Ultra-fast and accurate nanosecond-level timing utilities
Documentation
  • Coverage
  • 0%
    0 out of 6 items documented0 out of 5 items with examples
  • Size
  • Source code size: 18.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 80.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • TachyonConcepts/NanoClock
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • TachyonConcepts

🕒 nano-clock

Ultra-fast date/time formatting for HTTP headers and system profiling.
Written in Rust, sprinkled with inline assembly, optimized for the lowest latency possible.


🔥 Features

  • Returns current date/time in (i32, u8, u8, u8, u8, u8, u8) tuple format
    (year, month, day, hour, minute, second, weekday)
  • Blazing-fast formatting of HTTP date headers (Date: ... GMT) in preallocated buffers
  • Optional inline assembly (nano_clock_asm) for even lower latency
  • Includes both time() (wall-clock) and clock_gettime(CLOCK_MONOTONIC) for monotonic measurements
  • Zero allocations, no String, no chrono, no nonsense.

📦 Example

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());
}