From cabf821736a0cb237c84a8b2d495e0a37c95f005 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 May 2021 10:54:38 +0200 Subject: [PATCH] Print how much time it took to autosave dirty profiles This should provide some more info for #9594 --- cura/AutoSave.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cura/AutoSave.py b/cura/AutoSave.py index d80e34771e..3205f48af1 100644 --- a/cura/AutoSave.py +++ b/cura/AutoSave.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from PyQt5.QtCore import QTimer @@ -6,6 +6,8 @@ from typing import Any, TYPE_CHECKING from UM.Logger import Logger +import time + if TYPE_CHECKING: from cura.CuraApplication import CuraApplication @@ -56,8 +58,8 @@ class AutoSave: def _onTimeout(self) -> None: self._saving = True # To prevent the save process from triggering another autosave. - Logger.log("d", "Autosaving preferences, instances and profiles") + save_start_time = time.time() self._application.saveSettings() - + Logger.log("d", "Autosaving preferences, instances and profiles took %s seconds", time.time() - save_start_time) self._saving = False