log time taken to fetch memories

This commit is contained in:
ashilkn 2024-01-15 12:40:05 +05:30
parent ea8c648ce4
commit a7e6c34b13

View file

@ -85,6 +85,7 @@ class MemoriesService extends ChangeNotifier {
}
Future<List<Memory>> _fetchMemories() async {
final stopWatch = Stopwatch()..start();
_logger.info("Fetching memories");
final presentTime = DateTime.now();
final present = presentTime.subtract(
@ -121,6 +122,8 @@ class MemoriesService extends ChangeNotifier {
}
}
_cachedMemories = memories;
stopWatch.stop();
_logger.info("Fetched memories, duration: ${stopWatch.elapsed}");
return _cachedMemories!;
}