diff --git a/src/FarmThread.py b/src/FarmThread.py index d7e448d..777f0e4 100644 --- a/src/FarmThread.py +++ b/src/FarmThread.py @@ -1,4 +1,4 @@ -from datetime import datetime +from time import monotonic from threading import Thread from time import sleep from Browser import Browser @@ -60,7 +60,7 @@ def run(self): liveMatchesMsg = f"{', '.join(liveMatchesStatus)}" newDrops, totalDrops = self.browser.checkNewDrops(self.stats.getLastDropCheck(self.account)) self.stats.setTotalDrops(self.account, totalDrops) - self.stats.updateLastDropCheck(self.account, int(datetime.now().timestamp() * 1e3)) + self.stats.updateLastDropCheck(self.account, int(monotonic() * 1e3)) else: liveMatchesMsg = self.sharedData.getTimeUntilNextMatch() try: diff --git a/src/Stats.py b/src/Stats.py index c763aed..fe696c1 100644 --- a/src/Stats.py +++ b/src/Stats.py @@ -1,4 +1,6 @@ from datetime import datetime +from time import monotonic + class Stats: def __init__(self) -> None: @@ -13,7 +15,7 @@ def initNewAccount(self, accountName: str): "liveMatches": "", "status": "[yellow]WAIT", "failedLoginCounter": 0, - "lastDropCheck": int(datetime.now().timestamp()*1e3), + "lastDropCheck": int(monotonic() * 1e3), "valid" : True }