#cpu #stress #load #high #worker #timeout #simulates

stress-cpu

Utility that simulates a high cpu load

5 releases (breaking)

0.5.0 Dec 2, 2024
0.4.0 Dec 2, 2024
0.3.0 Dec 2, 2024
0.2.0 Dec 2, 2024
0.1.0 Dec 2, 2024

#110 in Simulation

Download history 326/week @ 2024-11-27 155/week @ 2024-12-04 5/week @ 2024-12-11

223 downloads per month

MIT/Apache

5KB

A simple Rust library for simulating a high cpu load. You can stress your CPU by specifying the number of workers and timeout in seconds. Each worker corresponds a native OS thread. For example,

fn main() {
    stress_cpu::stress(4, 30);
}

lib.rs:

Utility that simulates a high cpu load. It creates N OS native threads each of which spins in a tight loop calculating the sqrt() of a random number.

Dependencies

~2.6–8MB
~64K SLoC