Skip to content

Commit

Permalink
Fix runtime bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreso committed Sep 16, 2024
1 parent 0031094 commit d4c7a97
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ert/gui/simulation/run_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit d4c7a97

Please sign in to comment.