From f868fd423d30ea330c1f6ae27a5047b01ec317b5 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 14 Apr 2024 13:17:30 +0200 Subject: [PATCH] Fix for wake timer timing issues --- TheWatcher/SleepCtrl.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/TheWatcher/SleepCtrl.cs b/TheWatcher/SleepCtrl.cs index 05f5d9f..5f777ea 100644 --- a/TheWatcher/SleepCtrl.cs +++ b/TheWatcher/SleepCtrl.cs @@ -16,6 +16,7 @@ public class SleepCtrl bool suspended = NativeMethods.SetSuspendState(false, false, false); if (suspended) { + dt = dt.AddSeconds(-5); if (DateTime.Now < dt) { Console.WriteLine($"[{DateTime.Now}] Resumed from suspend, but expected to sleep until {dt} => deactivating sleep");