From 4321597c8092cec18cf942c3e95a69f500ae8931 Mon Sep 17 00:00:00 2001 From: Daniel Havlik Date: Sun, 30 Oct 2022 11:17:23 +0100 Subject: [PATCH] fix issues with clock changes inbetween scans --- SunGather/sungather.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SunGather/sungather.py b/SunGather/sungather.py index 285d500..5770f23 100644 --- a/SunGather/sungather.py +++ b/SunGather/sungather.py @@ -552,7 +552,7 @@ def main(): # Core polling loop while True: - loop_start = datetime.now() + loop_start = time.perf_counter() inverter.checkConnection() @@ -567,8 +567,8 @@ def main(): inverter.disconnect() logging.warning(f"Data collection failed, skipped exporting data. Retying in {scan_interval} secs") - loop_end = datetime.now() - process_time = round(float(((loop_end - loop_start).seconds) + ((loop_end - loop_start).microseconds / 1000000)),2) + loop_end = time.perf_counter() + process_time = round(loop_end - loop_start, 2) logging.debug(f'Processing Time: {process_time} secs') if 'runonce' in locals():