久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='P0GHk'><style id='P0GHk'><dir id='P0GHk'><q id='P0GHk'></q></dir></style></legend>
<tfoot id='P0GHk'></tfoot>
    <bdo id='P0GHk'></bdo><ul id='P0GHk'></ul>
    <i id='P0GHk'><tr id='P0GHk'><dt id='P0GHk'><q id='P0GHk'><span id='P0GHk'><b id='P0GHk'><form id='P0GHk'><ins id='P0GHk'></ins><ul id='P0GHk'></ul><sub id='P0GHk'></sub></form><legend id='P0GHk'></legend><bdo id='P0GHk'><pre id='P0GHk'><center id='P0GHk'></center></pre></bdo></b><th id='P0GHk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='P0GHk'><tfoot id='P0GHk'></tfoot><dl id='P0GHk'><fieldset id='P0GHk'></fieldset></dl></div>

      1. <small id='P0GHk'></small><noframes id='P0GHk'>

        WinAPI Sleep() 函數調用休眠的時間比預期的要長

        WinAPI Sleep() function call sleeps for longer than expected(WinAPI Sleep() 函數調用休眠的時間比預期的要長)
      2. <tfoot id='2XIiW'></tfoot>

              <bdo id='2XIiW'></bdo><ul id='2XIiW'></ul>
              <legend id='2XIiW'><style id='2XIiW'><dir id='2XIiW'><q id='2XIiW'></q></dir></style></legend>

                <small id='2XIiW'></small><noframes id='2XIiW'>

                  <tbody id='2XIiW'></tbody>

                1. <i id='2XIiW'><tr id='2XIiW'><dt id='2XIiW'><q id='2XIiW'><span id='2XIiW'><b id='2XIiW'><form id='2XIiW'><ins id='2XIiW'></ins><ul id='2XIiW'></ul><sub id='2XIiW'></sub></form><legend id='2XIiW'></legend><bdo id='2XIiW'><pre id='2XIiW'><center id='2XIiW'></center></pre></bdo></b><th id='2XIiW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2XIiW'><tfoot id='2XIiW'></tfoot><dl id='2XIiW'><fieldset id='2XIiW'></fieldset></dl></div>

                2. 本文介紹了WinAPI Sleep() 函數調用休眠的時間比預期的要長的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  操作系統:Windows 7

                  OS: Windows 7

                  當調用 WinAPI Sleep() 函數作為 Sleep(1) 時,線程實際上會休眠 15 毫秒.我循環了 100 次,總睡眠時間是 1500 毫秒而不是 100 毫秒.

                  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 1500ms instead of 100.

                  這是常見行為還是我應該擔心我的 MOBO、CPU、Windows 安裝出現問題?

                  Is this common behavior or should I be concerced about something being wrong with my MOBO, CPU, Windows installion?

                  如果可能,您可以運行此代碼并發布睡眠時間有多長.我讓我的一個朋友運行了這個,他實際上在 1 毫秒內就完成了.

                  If possible could you run this code and post how long the sleep time was. I let a friend of mine run this, and he actually had it all at 1ms.

                  #include <iostream>
                  #include <ctime>
                  #include <Windows.h>
                  
                  void test(void)
                  {
                      std::cout << "Testing 1ms sleep." << std::endl;
                  
                      for (unsigned int i = 0; i < 10; i++)
                      {
                          std::clock_t startClocks = std::clock();
                  
                          Sleep(1);
                  
                          std::clock_t clocksTaken = std::clock() - startClocks;
                          std::cout << "Time: " << clocksTaken << "ms." << std::endl;
                      }
                  }
                  
                  int main(void)
                  {
                      test();
                  
                      std::cin.sync();
                      std::cin.get();
                      return 0;
                  }
                  

                  似乎有些人得到 1ms 的原因是其他一些程序正在運行,將系統范圍的計時器分辨率設置為 1ms.默認情況下,這在 Windows 7 上應該是 15.6 毫秒.

                  It seems that the reason why some people are getting 1ms is that some other program is running that sets the system-wide timer resolution to 1ms. By default this should be 15.6ms on Windows 7.

                  推薦答案

                  這是常見的行為嗎

                  Is this common behavior

                  是的.

                  Window 的線程調度程序在時間片上工作(確切長度取決于各種因素,包括 Windows 版本和版本).實際上,任何非零延遲都會向上舍入為一個完整的量程.

                  Window's thread scheduler works on a time quantum (exact length depends of various factors including Windows version and edition). Effectively any non-zero delay is rounded up to a complete quantum.

                  這篇關于WinAPI Sleep() 函數調用休眠的時間比預期的要長的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)

                      <tbody id='Wbtjq'></tbody>
                    1. <small id='Wbtjq'></small><noframes id='Wbtjq'>

                      <legend id='Wbtjq'><style id='Wbtjq'><dir id='Wbtjq'><q id='Wbtjq'></q></dir></style></legend><tfoot id='Wbtjq'></tfoot>

                            <bdo id='Wbtjq'></bdo><ul id='Wbtjq'></ul>
                          • <i id='Wbtjq'><tr id='Wbtjq'><dt id='Wbtjq'><q id='Wbtjq'><span id='Wbtjq'><b id='Wbtjq'><form id='Wbtjq'><ins id='Wbtjq'></ins><ul id='Wbtjq'></ul><sub id='Wbtjq'></sub></form><legend id='Wbtjq'></legend><bdo id='Wbtjq'><pre id='Wbtjq'><center id='Wbtjq'></center></pre></bdo></b><th id='Wbtjq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Wbtjq'><tfoot id='Wbtjq'></tfoot><dl id='Wbtjq'><fieldset id='Wbtjq'></fieldset></dl></div>
                            主站蜘蛛池模板: 国产精品视频久久久久 | 夜夜久久 | 91在线看| 日韩综合在线 | 免费的黄色片子 | 国产欧美日韩二区 | aaaaa毛片| 欧美中文字幕 | 91在线精品视频 | 成人黄在线观看 | 久久区二区 | 日韩久久中文字幕 | 91中文在线观看 | 一级片子 | 欧美亚洲国产一区二区三区 | 操久久| 成人免费观看男女羞羞视频 | av一区二区在线观看 | av中文字幕在线观看 | 国产精品久久久久久久免费大片 | av天空| 亚洲国产精品一区二区三区 | 蜜桃一区二区三区 | 欧美日韩电影免费观看 | 成人在线观看中文字幕 | 91成人精品 | 国产精品一区久久久久 | 欧美精品网站 | 成人激情视频免费在线观看 | 特一级毛片 | 久久久久久久91 | 成人3d动漫一区二区三区91 | 久草免费福利 | 在线2区| 四虎影院在线观看av | 日韩精品视频在线免费观看 | 国产一级特黄aaa大片评分 | 欧美一区二区三 | 人妖一区 | 国产.com | 久久久精品 |