问题描述
无论如何在windows环境中睡眠约1微秒?在研究和阅读了许多线程和各种网站后,我还没有看到这是可能的.由于调度程序似乎是限制因素并且它运行在 1 毫秒级别,那么我相信它不能不进入实时操作系统.
Is there anyway at all in the windows environment to sleep for ~1 microsecond? After researching and reading many threads and various websites, I have not been able to see that this is possible. Since the scheduler appears to be the limiting factor and it operatesat the 1 millisecond level, then I believe it can't be done without going to a real time OS.
推荐答案
它可能不是最便携的,我自己也没有使用过这些功能,但也许可以使用高分辨率计时器中的信息此链接和块的部分:QueryPerformanceCounter
It may not be the most portable, and I've not used these functions myself, but it might be possible to use the information in the High-Resolution Timer section of this link and block: QueryPerformanceCounter
这篇关于windows c++ 和微秒睡眠的可能性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!