BatteryBenchmark class
Benchmark session for measuring battery consumption.
Use this to compare battery usage between different configurations.
Example:
final benchmark = BatteryBenchmark();
await benchmark.start();
// ... run your tracking session ...
final result = await benchmark.finish();
print('Drain: ${result.drainPercent}% over ${result.duration.inMinutes} min');
Constructors
Properties
Methods
-
finish(
{required int currentBattery}) → BenchmarkResult - Finishes the benchmark and returns results.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordGpsOff(
) → void - Records GPS being turned off.
-
recordGpsOn(
) → void - Records GPS being turned on.
-
recordLocationUpdate(
{double? accuracy}) → void - Records a location update.
-
recordStateChange(
String newState) → void - Records a motion state change.
-
recordSync(
) → void - Records an HTTP sync request.
-
start(
{required int initialBattery}) → void - Starts the benchmark session.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited