| Crates.io | tunjukin_suhu_cpu_windows |
| lib.rs | tunjukin_suhu_cpu_windows |
| version | 0.1.0 |
| created_at | 2025-09-26 15:22:58.561897+00 |
| updated_at | 2025-09-26 15:22:58.561897+00 |
| description | A simple library for reading CPU temperature on Windows systems using WMI queries |
| homepage | |
| repository | https://github.com/SFINXVC/tunjukin_suhu_cpu_windows |
| max_upload_size | |
| id | 1856057 |
| size | 15,262 |
A simple and efficient Rust library for reading CPU temperature on Windows systems using WMI (Windows Management Instrumentation) queries.
regex)Add this to your Cargo.toml:
[dependencies]
tunjukin_suhu_cpu_windows = "0.1.0"
use tunjukin_suhu_cpu_windows::CpuTemperature;
fn main() {
match CpuTemperature::get() {
Ok(temp) => {
println!("CPU Temperature: {:.2}°C / {:.2}°F",
temp.celsius, temp.fahrenheit);
}
Err(e) => {
eprintln!("Error reading temperature: {}", e);
}
}
}
Run the included example:
cargo run --example simple
CpuTemperatureThe main struct representing a temperature reading.
celsius: f64 - Temperature in degrees Celsiusfahrenheit: f64 - Temperature in degrees FahrenheitCpuTemperature::get() -> Result<CpuTemperature, String> - Gets the current CPU temperatureThis library uses Windows Management Instrumentation (WMI) to query thermal zone sensors through PowerShell. It:
MSAcpi_ThermalZoneTemperatureThe library provides detailed error messages for common issues:
If you encounter errors:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under either of
at your option.
This library is designed to be a simple, reliable solution for CPU temperature monitoring on Windows systems.