• <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  評(píng)論-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) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 數(shù)據(jù)結(jié)構(gòu)與算法
            久久久久婷婷| 99久久免费国产特黄| 久久天天日天天操综合伊人av| 97精品伊人久久久大香线蕉| 久久99精品久久久久久齐齐| 伊人久久久AV老熟妇色| 久久久久久久综合日本亚洲 | 国产精品久久久久久福利69堂| 国产精品久久免费| 久久久这里有精品| 久久91综合国产91久久精品| 久久婷婷色综合一区二区| 亚洲国产精品无码久久SM| 国产亚洲精久久久久久无码AV| 一本一本久久A久久综合精品| 激情五月综合综合久久69| 久久国产高潮流白浆免费观看| 国产精品久久久天天影视香蕉| 亚洲国产精品无码久久久秋霞2 | 久久精品国产亚洲AV不卡| 日本一区精品久久久久影院| 无码人妻久久一区二区三区| 国产香蕉97碰碰久久人人| 久久国产精品成人影院| 中文字幕久久精品| 手机看片久久高清国产日韩| 精品久久久久久99人妻| 狠狠色丁香婷婷综合久久来| 亚洲AV无码久久| 久久99国产精品久久99小说 | 91久久福利国产成人精品| 亚洲精品白浆高清久久久久久 | 国产情侣久久久久aⅴ免费| 亚洲人成无码网站久久99热国产| 国产精品一久久香蕉国产线看| 国产偷久久久精品专区| 97精品依人久久久大香线蕉97| 久久久久免费精品国产| 亚洲中文字幕无码久久精品1| 2021国内精品久久久久久影院| 亚洲日韩欧美一区久久久久我|