• <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 閱讀(568) 評論(0)  編輯 收藏 引用 所屬分類: 數(shù)據(jù)結構與算法
            浪潮AV色综合久久天堂| 久久久无码一区二区三区| 99久久精品免费| 91久久精品国产成人久久| 99热都是精品久久久久久| 久久综合色区| 2021国产精品午夜久久| 久久国产精品无码一区二区三区| 亚洲AV日韩AV永久无码久久| 国内精品久久久久伊人av| 国产香蕉97碰碰久久人人| 伊人精品久久久久7777| 久久99精品国产麻豆宅宅| 久久香蕉国产线看观看猫咪?v| 久久精品国产乱子伦| 7国产欧美日韩综合天堂中文久久久久 | 久久久久亚洲AV成人片| 99久久精品免费看国产| 99久久国产宗和精品1上映| 精品免费tv久久久久久久| 四虎影视久久久免费观看| 亚洲∧v久久久无码精品| 久久国产乱子伦精品免费强| 久久久久国色AV免费看图片| 久久综合精品国产二区无码| 91麻精品国产91久久久久| 7777久久久国产精品消防器材 | 国内精品久久久久久99蜜桃| 久久国产综合精品五月天| 国产亚洲精品自在久久| 久久亚洲AV无码精品色午夜麻豆| 国内精品久久久久久不卡影院 | 久久精品免费观看| 久久久久久精品免费看SSS | 亚洲国产成人精品久久久国产成人一区二区三区综| 午夜天堂av天堂久久久| 亚洲精品无码专区久久同性男| 久久996热精品xxxx| 7国产欧美日韩综合天堂中文久久久久| 午夜人妻久久久久久久久| 亚洲∧v久久久无码精品|