ente/lib/extensions/stop_watch.dart

17 lines
364 B
Dart
Raw Normal View History

2022-11-13 00:50:11 +00:00
import 'package:flutter/foundation.dart';
class EnteWatch extends Stopwatch {
final String context;
EnteWatch(this.context) : super();
2022-11-13 00:50:11 +00:00
void log(String msg) {
debugPrint("[$context]: $msg took ${elapsed.inMilliseconds} ms");
2022-11-13 00:50:11 +00:00
}
void logAndReset(String msg) {
debugPrint("[$context]: $msg took ${elapsed.inMilliseconds} ms");
2022-11-13 00:50:11 +00:00
reset();
}
}