Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Implement high-resolution timer infrastructure for task scheduling #69

@alexrp

Description

@alexrp

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.

Metadata

Metadata

Assignees

Labels

area: commonIssues related to the shared utility APIs.state: approvedEnhancements and tasks that have been approved.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions