Skip to content

Commit

Permalink
dev demo: print instead of debugLog for stopwatching
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Oct 23, 2023
1 parent 42e63db commit 04e199b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/model/store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class PerAccountStore extends ChangeNotifier {
final stopwatch = Stopwatch()..start();
unreads.handleMessageEvent(event);
final t = (stopwatch..stop()).elapsed;
assert(debugLog('handleMessageEvent time: ${t.inMilliseconds}ms'));
print('handleMessageEvent time: ${t.inMilliseconds}ms');
} else if (event is UpdateMessageEvent) {
assert(debugLog("server event: update_message ${event.messageId}"));
for (final view in _messageListViews) {
Expand All @@ -321,14 +321,14 @@ class PerAccountStore extends ChangeNotifier {
final stopwatch = Stopwatch()..start();
unreads.handleUpdateMessageEvent(event);
final t = (stopwatch..stop()).elapsed;
assert(debugLog('handleUpdateMessageEvent time: ${t.inMilliseconds}ms'));
print('handleUpdateMessageEvent time: ${t.inMilliseconds}ms');
} else if (event is DeleteMessageEvent) {
assert(debugLog("server event: delete_message ${event.messageIds}"));
// TODO handle in message lists
final stopwatch = Stopwatch()..start();
unreads.handleDeleteMessageEvent(event);
final t = (stopwatch..stop()).elapsed;
assert(debugLog('handleDeleteMessageEvent time: ${t.inMilliseconds}ms'));
print('handleDeleteMessageEvent time: ${t.inMilliseconds}ms');
} else if (event is UpdateMessageFlagsEvent) {
assert(debugLog("server event: update_message_flags/${event.op} ${event.flag.toJson()}"));
for (final view in _messageListViews) {
Expand All @@ -337,7 +337,7 @@ class PerAccountStore extends ChangeNotifier {
final stopwatch = Stopwatch()..start();
unreads.handleUpdateMessageFlagsEvent(event);
final t = (stopwatch..stop()).elapsed;
assert(debugLog('handleUpdateMessageFlagsEvent time: ${t.inMilliseconds}ms'));
print('handleUpdateMessageFlagsEvent time: ${t.inMilliseconds}ms');
} else if (event is ReactionEvent) {
assert(debugLog("server event: reaction/${event.op}"));
for (final view in _messageListViews) {
Expand Down
2 changes: 1 addition & 1 deletion lib/model/unreads.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Unreads extends ChangeNotifier {
);

final t = (stopwatch..stop()).elapsed;
assert(debugLog('Unreads constructor time: ${t.inMilliseconds}ms'));
print('Unreads constructor time: ${t.inMilliseconds}ms (`count` is ${initial.count})');

return result;
}
Expand Down

0 comments on commit 04e199b

Please sign in to comment.