-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Sys_MillisecondsPrecise() and Sys_SleepUntilPrecise()
Sys_MillisecondsPrecise() returns the milliseconds since start of the engine as a double, so it can also represent micro- or even nanoseconds. Sys_Milliseconds() now just returns that value casted to unsigned int, for backwards compatibility. Sys_SleepUntilPrecise( double targetTimeMS ) sleeps until Sys_MillisecondsPrecise() returns a value >= targetTimeMS. It aims to have a precision of about 0.01ms (10usec), and achieves that by using a busy loop (with pause instructions) for the last 1-2 ms
- Loading branch information
1 parent
2dd8ac6
commit f02245d
Showing
5 changed files
with
373 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.