diff options
author | weidai <weidai11@users.noreply.github.com> | 2003-06-19 17:09:07 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2003-06-19 17:09:07 +0000 |
commit | 376fe5b4ae1607f4158e16bc4ace6e5b5b01154e (patch) | |
tree | 7e300cb2827b1bf3cc05695e5e89b5ef58b1be93 /hrtimer.h | |
parent | 5b25f4b45fb67c48df4dd576f3271fe00e30796b (diff) | |
download | cryptopp-git-376fe5b4ae1607f4158e16bc4ace6e5b5b01154e.tar.gz |
sync with private branch
Diffstat (limited to 'hrtimer.h')
-rw-r--r-- | hrtimer.h | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -11,23 +11,16 @@ NAMESPACE_BEGIN(CryptoPP) class Timer { public: - enum Unit {SECONDS, MILLISECONDS, MICROSECONDS}; + enum Unit {SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS}; Timer(Unit unit, bool stuckAtZero = false) : m_timerUnit(unit), m_stuckAtZero(stuckAtZero), m_started(false) {} static word64 GetCurrentTimerValue(); // GetCurrentTime is a macro in MSVC 6.0 - static unsigned long ConvertTo(word64 t, Unit unit); - - // this is not the resolution, just a conversion factor into milliseconds - static inline unsigned int TicksPerMillisecond() - { -#if defined(CRYPTOPP_WIN32_AVAILABLE) - return 10000; -#elif defined(CRYPTOPP_UNIX_AVAILABLE) || defined(macintosh) - return 1000; -#endif - } + static word64 ConvertTo(word64 t, Unit unit); + // this is not the resolution, just a conversion factor into seconds + static word64 TicksPerSecond(); void StartTimer(); + word64 ElapsedTimeInWord64(); unsigned long ElapsedTime(); private: |