123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef __FOO_TIME_COUNT__2005_03_03__H__
- #define __FOO_TIME_COUNT__2005_03_03__H__
- #include <time.h>
- class FCTimeCount
- {
- clock_t m_nTick ;
- public:
-
- FCTimeCount() {SetStartTag();}
-
- void SetStartTag() {m_nTick = ::clock();}
-
- int GetPassMillisecond() const {return (int)tick_to_ms(::clock() - m_nTick);}
- static clock_t tick_to_ms (clock_t nTick)
- {
- return (nTick * 1000 / CLOCKS_PER_SEC) ;
- }
- };
- #endif
|