• <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 閱讀(564) 評論(0)  編輯 收藏 引用 所屬分類: 數(shù)據(jù)結(jié)構(gòu)與算法
            一本一道久久a久久精品综合| 人妻无码αv中文字幕久久琪琪布 人妻无码久久一区二区三区免费 人妻无码中文久久久久专区 | 97久久精品无码一区二区天美| 色综合合久久天天综合绕视看| 欧美精品福利视频一区二区三区久久久精品| 欧美精品九九99久久在观看| 欧美熟妇另类久久久久久不卡| 2021久久精品国产99国产精品| 伊人久久大香线焦综合四虎| 久久亚洲私人国产精品vA| 国产91色综合久久免费| 人人狠狠综合久久亚洲| 伊人久久大香线蕉影院95| 亚洲欧美国产精品专区久久 | 天天爽天天狠久久久综合麻豆| 久久九色综合九色99伊人| 国产产无码乱码精品久久鸭 | 久久99热只有频精品8| 久久久久九国产精品| 久久久久人妻一区精品性色av| 久久人人爽人人爽人人片AV不 | 久久精品国产精品亚洲| 91精品国产综合久久久久久| 久久无码AV中文出轨人妻| 一本大道久久香蕉成人网| 久久久久综合网久久| 亚洲AV无码成人网站久久精品大| 久久精品亚洲欧美日韩久久| 久久99精品国产99久久6男男| 国产精品久久久久久福利漫画| 久久免费视频1| 久久久精品国产| 日本加勒比久久精品| 久久AAAA片一区二区| 女同久久| 品成人欧美大片久久国产欧美| 国内精品久久久久久久影视麻豆| 精品久久无码中文字幕| 亚洲国产精品无码久久一线| 色8久久人人97超碰香蕉987| 久久青青草原精品国产|