Skip to content

Commit

Permalink
Use relative time in PrecisionSleepWindowsHighResolution
Browse files Browse the repository at this point in the history
Duh.
  • Loading branch information
PJB3005 committed Jul 15, 2023
1 parent 0a5a214 commit 681feaf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Robust.Shared/Timing/PrecisionSleep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ public PrecisionSleepWindowsHighResolution()
public override void Sleep(TimeSpan time)
{
LARGE_INTEGER due;
Windows.GetSystemTimeAsFileTime((FILETIME*)(&due));

due.QuadPart += time.Ticks;
// negative = relative time.
due.QuadPart = -time.Ticks;

var success = Windows.SetWaitableTimer(
_timerHandle,
Expand Down

0 comments on commit 681feaf

Please sign in to comment.