WinAPI Sleep() function call sleeps for longer than expected

后端 未结 7 559
清歌不尽
清歌不尽 2020-11-27 07:57

OS: Windows 7

When calling the WinAPI Sleep() function as Sleep(1) the thread actually sleeps for 15ms. I did it 100 times in a loop and the total sleep time was 150

相关标签:
7条回答
  • 2020-11-27 08:18

    You should check your machine's timer resolution. See the msdn documentation of Sleep() for details.

    0 讨论(0)
提交回复
热议问题