Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/exoad/better_cpu_reader
Rewrite of the "cpu_reader" package for Flutter to work with modern SDK versions
https://github.com/exoad/better_cpu_reader
dart flutter
Last synced: about 7 hours ago
JSON representation
Rewrite of the "cpu_reader" package for Flutter to work with modern SDK versions
- Host: GitHub
- URL: https://github.com/exoad/better_cpu_reader
- Owner: exoad
- License: other
- Created: 2023-07-19T21:50:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-20T12:56:19.000Z (over 1 year ago)
- Last Synced: 2024-08-31T09:51:30.817Z (2 months ago)
- Topics: dart, flutter
- Language: Kotlin
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cpu_reader
> **Warning**: This is a rewrite of the original with some minor changes to work with the newer Dart Sound Safety specifications
A basic CPU reader that provides a simple way of retrieving device CPU info (Currently only supports Android).
# Usage
To use this rewrite, put this in your `pubspec.yaml`:
```yaml
dependencies:
better_cpu_reader:
git:
url: https://github.com/exoad/better_cpu_reader.git
```View it **pub.dev** [here](https://pub.dev/packages/better_cpu_reader) and install it with:
```bash
flutter pub add better_cpu_reader
```You can view the original package [here](https://github.com/igrik12/cpu_reader).
Example:
```dart
import 'package:better_cpu_reader/cpu_reader.dart';
import 'package:better_cpu_reader/cpuinfo.dart';CpuInfo cpuInfo = await CpuReader.cpuInfo;
print('Number of Cores ${cpuInfo.numberOfCores}');int freq = await CpuReader.getCurrentFrequency(2);
print('Core number 2 freq ${freq} Mhz');CpuReader.asStream(Duration(milliseconds: 1000)).listen((cpuInfo) => print("Temperature: ${cpuInfo.cpuTemperature}"))
```