From d4c7a972c1fbbc6c12ad6ab55754b4f14d000448 Mon Sep 17 00:00:00 2001 From: Sondre Sortland Date: Mon, 16 Sep 2024 13:09:29 +0200 Subject: [PATCH] Fix runtime bug --- src/ert/gui/simulation/run_dialog.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ert/gui/simulation/run_dialog.py b/src/ert/gui/simulation/run_dialog.py index 659dd3de726..c6173ab3940 100644 --- a/src/ert/gui/simulation/run_dialog.py +++ b/src/ert/gui/simulation/run_dialog.py @@ -398,8 +398,7 @@ def _on_simulation_done(self, failed: bool, msg: str) -> None: else: self.update_total_progress(1.0, "Experiment completed.") - @Slot() - def _on_ticker(self) -> None: + def _update_runtime(self): if self._start_time is None: runtime = 0 elif self._end_time is None: @@ -408,6 +407,10 @@ def _on_ticker(self) -> None: runtime = (self._end_time - self._start_time).total_seconds() self.running_time.setText(format_running_time(runtime)) + @Slot() + def _on_ticker(self) -> None: + self._update_runtime() + maximum_memory_usage = self._snapshot_model.root.max_memory_usage if maximum_memory_usage: @@ -423,6 +426,7 @@ def _on_event(self, event: object) -> None: self._end_time = event.timestamp self.simulation_done.emit(event.failed, event.msg) self._ticker.stop() + self._update_runtime() self.done_button.setHidden(False) elif isinstance(event, FullSnapshotEvent): if event.snapshot is not None: