active-time

Crates.ioactive-time
lib.rsactive-time
version0.1.2
sourcesrc
created_at2023-03-08 19:35:41.84941
updated_at2023-03-09 05:36:52.698285
descriptionA Rust crate to find out the current amount of time the system has been active, excluding time spent hibernating/sleeping.
homepage
repositoryhttps://github.com/M1ngXU/active-time
max_upload_size
id805036
size4,435
(M1ngXU)

documentation

README

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.

Commit count: 7

cargo fmt