Skip to content

Commit ed4ac8f

Browse files
committed
Ignore adjustment if time is within milliseconds
1 parent 40e9e43 commit ed4ac8f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ void updateTime() {
179179

180180
time += OSSecondsToTicks(offsetMinutes * 60);
181181

182+
OSTime currentTime = OSGetTime();
183+
int timeDifference = abs(time - currentTime);
184+
185+
if (static_cast<uint64_t>(timeDifference) <= OSMillisecondsToTicks(250)) {
186+
return; // Time difference is within 250 milliseconds, no need to update.
187+
}
188+
182189
SetSystemTime(time); // This finally sets the console time.
183190
}
184191

0 commit comments

Comments
 (0)