/light-cpu-loader

Primary LanguageC++MIT LicenseMIT

Control CPU loading to 1~2%

This project simulates controlled CPU usage for testing and benchmarking purposes, allowing fine-tuning of resource consumption.

Get Started

shell script version

bash main.sh

C++ version

sudo apt install make g++
make
./main

Adjusting CPU Usage

To fine-tune the CPU usage, modify the BUSY_TIME and IDLE_TIME variables in the source code to adjust the balance between active and idle periods.