You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/01/10 22:50:53 UTC

[GitHub] [beam] KonradJanica commented on a change in pull request #16363: [BEAM-13557] [Playground] show code execution time

KonradJanica commented on a change in pull request #16363:
URL: https://github.com/apache/beam/pull/16363#discussion_r781633925



##########
File path: playground/frontend/lib/pages/playground/states/playground_state.dart
##########
@@ -156,6 +166,39 @@ class PlaygroundState with ChangeNotifier {
       status: RunCodeStatus.finished,
       output: _selectedExample!.outputs,
     );
+    _executionTime?.close();
     notifyListeners();
   }
+
+  StreamController<int> _createExecutionTimeStream() {
+    StreamController<int>? streamController;
+    Timer? timer;
+    Duration timerInterval = const Duration(milliseconds: kExecutionTimeUpdate);
+    int ms = 0;
+
+    void stopTimer() {
+      if (timer != null) {
+        timer?.cancel();

Review comment:
       The question mark is just a shorthand null check, so this code compiles to:
   ```
   if (timer != null) {
       if (timer != null) {
          timer.cancel();
       }
   }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org