CURA-4785 added logging for measuring time for validation check

This commit is contained in:
Jack Ha 2018-01-23 09:21:38 +01:00
parent 3fb9877a30
commit dc119d74bd

View file

@ -1,6 +1,7 @@
# Copyright (c) 2017 Ultimaker B.V. # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher. # Cura is released under the terms of the LGPLv3 or higher.
import time
#Type hinting. #Type hinting.
from typing import Union, List, Dict from typing import Union, List, Dict
@ -390,6 +391,7 @@ class MachineManager(QObject):
Logger.log("w", "Failed creating a new machine!") Logger.log("w", "Failed creating a new machine!")
def _checkStacksHaveErrors(self) -> bool: def _checkStacksHaveErrors(self) -> bool:
time_start = time.time()
if self._global_container_stack is None: #No active machine. if self._global_container_stack is None: #No active machine.
return False return False
@ -405,6 +407,7 @@ class MachineManager(QObject):
if stack.hasErrors(): if stack.hasErrors():
return True return True
Logger.log("d", "Checking stacks for errors took %.2f s" % (time.time() - time_start))
return False return False
## Remove all instances from the top instanceContainer (effectively removing all user-changed settings) ## Remove all instances from the top instanceContainer (effectively removing all user-changed settings)