• <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>
            隨筆-11  評論-20  文章-0  trackbacks-0
             1 #ifndef TIMER_CLASS
             2 #define TIMER_CLASS
             3 
             4 #include <time.h> // declares clock_t type, function clock(),
             5                   // and constant CLOCKS_PER_SEC
             6 
             7 class timer
             8 {
             9    private:
            10 
            11       // starting and ending time measured in clock ticks
            12       clock_t startTime, endTime;
            13 
            14    public:
            15       timer();
            16             // initialize the timer.
            17             // Postconditions: set the starting and ending event times to 0.
            18             // this creates an event whose time is 0.0
            19 
            20       void start();
            21             // start timing an event.
            22             // Postcondition:    record the current time as the starting time
            23         void stop();
            24             // stop timing an event.
            25             // Postconditon:    record the current time as the ending time
            26       double time() const;
            27             // return the time the event took in seconds by computing
            28             // the difference between the ending and starting times.
            29 };
            30 
            31 // ***********************************************************
            32 //      timer class implementation
            33 // ***********************************************************
            34 
            35 // constructor. set starting and ending times to 0
            36 timer::timer():startTime(0), endTime(0)
            37 {}
            38 
            39 // determine clock ticks at start
            40 void timer::start()
            41 {
            42    startTime = clock();
            43 }
            44 
            45 // determine clock ticks at end
            46 void timer::stop()
            47 {
            48    endTime = clock();
            49 }
            50 
            51 // return the elapsed time in seconds
            52 double timer::time() const
            53 {
            54    return (endTime-startTime)/double(CLOCKS_PER_SEC);
            55 }
            56 
            57 #endif   // TIMER_CLASS
            58 
            59 

            posted on 2009-08-31 21:28 diwayou 閱讀(560) 評論(0)  編輯 收藏 引用 所屬分類: 數據結構與算法
            久久精品国产色蜜蜜麻豆| 亚洲国产精品综合久久网络| 日本精品久久久久久久久免费| 国产三级精品久久| 久久国产精品久久| 久久国产成人午夜AV影院| 久久无码中文字幕东京热| 青草国产精品久久久久久| 精品久久久无码中文字幕| 品成人欧美大片久久国产欧美...| 国产精品久久网| 久久精品国产男包| 久久亚洲国产成人影院网站| 久久精品国产网红主播| 久久国产精品一区| 久久婷婷五月综合97色一本一本 | 久久精品人人做人人爽97| 韩国免费A级毛片久久| 99久久国产主播综合精品| 狠狠色狠狠色综合久久| 国产免费久久精品99久久| 久久e热在这里只有国产中文精品99| 久久久精品国产Sm最大网站| 成人久久免费网站| 久久Av无码精品人妻系列| 久久久91精品国产一区二区三区 | 久久精品无码一区二区无码| 97久久香蕉国产线看观看| 伊人久久大香线蕉精品| 亚洲精品久久久www| 久久久久亚洲精品天堂| 精品久久久无码中文字幕天天| 一本久久精品一区二区| 97久久久精品综合88久久| 久久免费99精品国产自在现线| 成人午夜精品无码区久久| 91久久香蕉国产熟女线看| 中文字幕人妻色偷偷久久| 国产91久久综合| 久久99精品久久久久久久久久 | 久久亚洲国产成人影院网站 |