• <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 閱讀(565) 評論(0)  編輯 收藏 引用 所屬分類: 數據結構與算法
            久久久久久久精品妇女99| 香港aa三级久久三级老师2021国产三级精品三级在 | 久久精品国产2020| 日本强好片久久久久久AAA | 蜜桃麻豆www久久| 久久天天躁狠狠躁夜夜av浪潮| 久久99热这里只频精品6| 久久婷婷五月综合国产尤物app| 91久久精品视频| 99蜜桃臀久久久欧美精品网站 | 久久99国产精品久久99| 久久天天躁狠狠躁夜夜不卡 | 国产精品久久久久天天影视| 国内精品久久久久久久久| 久久亚洲熟女cc98cm| 久久精品国产福利国产秒| 伊人久久一区二区三区无码| 狠狠色噜噜狠狠狠狠狠色综合久久| 亚洲国产精品成人久久蜜臀 | 亚洲国产成人精品91久久久| 久久亚洲AV成人出白浆无码国产| 久久99久久成人免费播放| 国产亚洲精品美女久久久| 久久综合亚洲色HEZYO社区| 国产成人综合久久精品尤物| 久久免费高清视频| 亚洲AV无码久久精品狠狠爱浪潮| 亚洲а∨天堂久久精品9966| 9191精品国产免费久久| 香蕉久久一区二区不卡无毒影院 | 久久亚洲精品无码观看不卡| 亚洲国产精品热久久| 久久se精品一区精品二区| 久久久久亚洲AV成人片| 久久九九久精品国产免费直播| 日韩亚洲国产综合久久久| 久久99精品久久久久久不卡| 99久久婷婷国产一区二区 | 久久亚洲中文字幕精品一区| 久久伊人五月丁香狠狠色| 亚洲精品tv久久久久久久久|