1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 02:48:23 +08:00

Optimize: 战斗中放慢截图速度, 降低CPU使用

This commit is contained in:
LmeSzinc
2020-04-27 23:59:51 +08:00
parent 9dc69c7fac
commit ef5885767e
8 changed files with 31 additions and 4 deletions

View File

@@ -60,5 +60,13 @@ class Timer:
def reset(self):
self._current = time.time()
def wait(self):
"""
Wait until timer reached.
"""
diff = self._current + self.limit - time.time()
if diff > 0:
time.sleep(diff)
def show(self):
logger.info('%s s' % str(self.current()))