• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 224  文章 - 41  trackbacks - 0
            <2011年5月>
            24252627282930
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            享受編程

            常用鏈接

            留言簿(11)

            隨筆分類(159)

            隨筆檔案(224)

            文章分類(2)

            文章檔案(4)

            經典c++博客

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            MSDN clock

            經常忘記寫一下:

            Example

            /* CLOCK.C: This example prompts for how long
            * the program is to run and then continuously
            * displays the elapsed time for that period.
            */
            #include <stdio.h>
            #include <stdlib.h>
            #include <time.h>
            void sleep( clock_t wait );
            void main( void )
            {
              long    i = 600000L;
              clock_t start, finish;
              double  duration;
              /* Delay for a specified time. */
              printf( "Delay for three seconds\n" );
              sleep( (clock_t)3 * CLOCKS_PER_SEC );
              printf( "Done!\n" );
              /* Measure the duration of an event. */
              printf( "Time to do %ld empty loops is ", i );
              start = clock();
              while( i-- )
                 ;
              finish = clock();
              duration = (double)(finish - start) / CLOCKS_PER_SEC;
              printf( "%2.1f seconds\n", duration );
            }
            /* Pauses for a specified number of milliseconds. */
            void sleep( clock_t wait )
            {
              clock_t goal;
              goal = wait + clock();
              while( goal > clock() )
                 ;
            }
            

            Output

            Delay for three seconds
            Done!
            Time to do 600000 empty loops is 0.1 seconds
            

             

            posted on 2009-02-26 15:31 漂漂 閱讀(942) 評論(0)  編輯 收藏 引用 所屬分類: 轉載經典文章
            久久一区二区三区99| 精品久久久久久久无码 | 色成年激情久久综合| 亚洲天堂久久精品| 亚洲欧美国产精品专区久久| 精品一二三区久久aaa片| 婷婷综合久久狠狠色99h| 热99RE久久精品这里都是精品免费| 人妻丰满AV无码久久不卡 | 久久一区二区三区免费| 青青草原精品99久久精品66| 狠狠精品久久久无码中文字幕 | 久久福利片| 精品久久久久久国产| 久久久精品人妻一区二区三区蜜桃| 97久久精品国产精品青草| 国产亚洲精久久久久久无码77777| 99久久精品免费| 国产精品久久久久AV福利动漫| 亚洲一区精品伊人久久伊人| 99久久国产免费福利| 狠狠狠色丁香婷婷综合久久俺| 久久久久久久综合狠狠综合| 国产精品无码久久综合网| 久久亚洲综合色一区二区三区| 久久久久久国产精品无码超碰| 超级碰碰碰碰97久久久久| 亚洲中文字幕伊人久久无码| 久久久久成人精品无码 | 久久综合视频网站| 久久精品中文字幕有码| 久久精品亚洲乱码伦伦中文| 久久精品无码一区二区三区日韩 | 99久久精品国产一区二区| 国产精品久久99| 国产精品午夜久久| 天堂无码久久综合东京热| 久久久久99精品成人片| 综合久久一区二区三区 | 精品无码人妻久久久久久| 精品久久久久久无码中文字幕|