mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Merge pull request #3333 from blob1807/change-time-sleep-doc
time.accurate_sleep Windows Doc update
This commit is contained in:
+2
-1
@@ -238,8 +238,9 @@ time_add :: proc "contextless" (t: Time, d: Duration) -> Time {
|
|||||||
//
|
//
|
||||||
// Accuracy seems to be pretty good out of the box on Linux, to within around 4µs worst case.
|
// Accuracy seems to be pretty good out of the box on Linux, to within around 4µs worst case.
|
||||||
// On Windows it depends but is comparable with regular sleep in the worst case.
|
// On Windows it depends but is comparable with regular sleep in the worst case.
|
||||||
// To get the same kind of accuracy as on Linux, have your program call `win32.time_begin_period(1)` to
|
// To get the same kind of accuracy as on Linux, have your program call `windows.timeBeginPeriod(1)` to
|
||||||
// tell Windows to use a more accurate timer for your process.
|
// tell Windows to use a more accurate timer for your process.
|
||||||
|
// Additionally your program should call `windows.timeEndPeriod(1)` once you're done with `accurate_sleep`.
|
||||||
accurate_sleep :: proc "contextless" (d: Duration) {
|
accurate_sleep :: proc "contextless" (d: Duration) {
|
||||||
to_sleep, estimate, mean, m2, count: Duration
|
to_sleep, estimate, mean, m2, count: Duration
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user