A Flutter plugin to get system CPU usage percentage on iOS devices.
- ✅ iOS
- ❌ Android (throws an error)
- Get total CPU usage percentage (0-100) for the whole system
Add this to your package's pubspec.yaml file:
dependencies:
kirz_cpu_info: ^0.1.0import 'package:kirz_cpu_info/kirz_cpu_info.dart';
try {
final usage = await KirzCpuInfo.getProcessorUsage();
print('CPU usage: ${usage.toStringAsFixed(1)}%');
} catch (e) {
print('Error: $e'); // Will throw on Android
}Uses HOST_CPU_LOAD_INFO tick deltas (user + system + nice) to compute a usage percentage.
Throws a PlatformException with code UNSUPPORTED_PLATFORM when called.
MIT License