active-time 0.1.2

A Rust crate to find out the current amount of time the system has been active, excluding time spent hibernating/sleeping.
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 3.96 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.11 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • M1ngXU/active-time
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • M1ngXU

active-time

crates.io docs.rs

A Rust crate to find out the current amount of time the system has been active, excluding time spent hibernating/sleeping.

Windows

This currently only works on Windows and uses the QueryUnbiasedInterruptTime method to query the current "ticks", which represent 100ns each.

Example

let active_time: Duration = active_time::active_time()?;

This prints the current active time. Check out the example for more information and also a comparation with Instant::elapsed when hibernating Windows while the program is running.