ecoprocess/ecoprocess.rs
1use std::{thread, time::Duration};
2
3use windows_eco::process::ProcessPowerThrottlingState;
4
5fn main() -> Result<(), windows_eco::Error> {
6 let mut state = ProcessPowerThrottlingState::from_windows()?;
7 println!("{state}");
8 state.enable_all_throttling();
9 state.apply()?;
10 println!("{state}");
11
12 thread::sleep(Duration::from_secs(30));
13
14 Ok(())
15}