I have thread that runs loop.I need that loop to be run once every 5ms (1ms error).I know that Sleep() function is not precise.Do you have any suggestions?Update.I can't do it other way.At the end of loop I need some kind of Sleep.I don't want to have 100% CPU loaded either. 解决方案 From the question tags I suppose you are on windows.Take a look at Multimedia Timers, they advertise precision under 1ms.Another options is to use Spin Locks but this will basically keep a cpu core at maximum usage. 这篇关于需要精确的线程睡眠.最大 1ms 误差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-12 01:19