Log time taken in turn processing.

This commit is contained in:
Dan Albert
2020-12-24 00:53:36 -08:00
parent 6aa1f1cca0
commit 2a65916f7c
2 changed files with 11 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
import logging
import timeit
from datetime import timedelta
from typing import List, Optional
from PySide2.QtWidgets import (
@@ -125,9 +128,12 @@ class QTopPanel(QFrame):
self.subwindow.show()
def passTurn(self):
start = timeit.default_timer()
self.game.pass_turn(no_action=True)
GameUpdateSignal.get_instance().updateGame(self.game)
self.proceedButton.setEnabled(True)
end = timeit.default_timer()
logging.info("Skipping turn took %s", timedelta(seconds=end - start))
def negative_start_packages(self) -> List[Package]:
packages = []