Skip to content

zaikir/flutter_cpu_info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kirz_cpu_info

A Flutter plugin to get system CPU usage percentage on iOS devices.

Platform Support

  • ✅ iOS
  • ❌ Android (throws an error)

Features

  • Get total CPU usage percentage (0-100) for the whole system

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  kirz_cpu_info: ^0.1.0

Usage

import '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
}

Platform-Specific Notes

iOS

Uses HOST_CPU_LOAD_INFO tick deltas (user + system + nice) to compute a usage percentage.

Android

Throws a PlatformException with code UNSUPPORTED_PLATFORM when called.

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published