odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.93k stars 611 forks source link

core:time accurate_sleep doc needs updating for win #3259

Closed blob1807 closed 7 months ago

blob1807 commented 8 months ago

The current documentation for time.accurate_sleep points to the old sys:win32. https://github.com/odin-lang/Odin/blob/fc9d3ec5a7246a57bc2a5fc7ac92b4de729da9b8/core/time/time.odin#L240
This should be changed to windows.timeBeginPeriod(1).

Additionally, as per the MS docs, timeEndPeriod needs to be run when you're done with the same value.
Suggesting defer windows.timeEndPeriod(1) should work for most people.

I don't know the best way to write the updated doc right now, so I'm just making an issue for it.

gingerBill commented 7 months ago

Can you make a PR for this change please.

blob1807 commented 7 months ago

NP will do.