windows-eco 0.1.0

A safe, idiomatic Rust wrapper for the Windows Power Throttling API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::{thread, time::Duration};

use windows_eco::process::ProcessPowerThrottlingState;

fn main() -> Result<(), windows_eco::Error> {
    let mut state = ProcessPowerThrottlingState::from_windows()?;
    println!("{state}");
    state.enable_all_throttling();
    state.apply()?;
    println!("{state}");

    thread::sleep(Duration::from_secs(30));

    Ok(())
}