Skip to main content

Crate system_idle_time

Crate system_idle_time 

Source
Expand description

§system-idle-time

Cross-platform Rust library for getting the last user input on the system.

§Supported Platforms

  • Windows
  • Linux (X11 and Wayland)
  • macOS

§Example

use system_idle_time::get_idle_time;

match get_idle_time() {
    Ok(idle_time) => println!("Idle time: {} ms", idle_time.as_millis()),
    Err(e) => eprintln!("Error getting idle time: {}", e),
}

Functions§

get_idle_time
Get system idle time as a Duration.