Browse Source

Print how much time it took to autosave dirty profiles

This should provide some more info for #9594
Jaime van Kessel 3 years ago
parent
commit
cabf821736
1 changed files with 5 additions and 3 deletions
  1. 5 3
      cura/AutoSave.py

+ 5 - 3
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