You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 16, 2025. It is now read-only.
Task.Delay() has around ~15 ms of overhead on Windows and ~10 ms on Linux. This is likely to be too much for some combat simulation tasks in the world server.
On Windows, we can implement a custom timer queue backed by CreateWaitableTimerExW (with the CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag) and SetWaitableTimer (with negative lpDueTime to avoid clock skew).
On Linux, we can use clock_nanosleep (with CLOCK_MONOTONIC_RAW to avoid clock skew) in a dedicated thread. We would need to send the thread a signal with pthread_kill when the due time needs to be updated.
Task.Delay()has around ~15 ms of overhead on Windows and ~10 ms on Linux. This is likely to be too much for some combat simulation tasks in the world server.On Windows, we can implement a custom timer queue backed by
CreateWaitableTimerExW(with theCREATE_WAITABLE_TIMER_HIGH_RESOLUTIONflag) andSetWaitableTimer(with negativelpDueTimeto avoid clock skew).On Linux, we can use
clock_nanosleep(withCLOCK_MONOTONIC_RAWto avoid clock skew) in a dedicated thread. We would need to send the thread a signal withpthread_killwhen the due time needs to be updated.