diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-04 15:04:58 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2007-05-04 15:04:58 +0000 |
commit | cdd57fd49c847250ce5d8e3cc39b7d882a529fc3 (patch) | |
tree | af7086b6bdb722b9a90c1abe0dd994166f32040b /hrtimer.h | |
parent | 061bcd669cf286d0043e1060bb36761df2df907e (diff) | |
download | cryptopp-cdd57fd49c847250ce5d8e3cc39b7d882a529fc3.tar.gz |
reduce risk of random number reuse after VM rollback
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@328 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'hrtimer.h')
-rw-r--r-- | hrtimer.h | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -5,14 +5,19 @@ NAMESPACE_BEGIN(CryptoPP) -#ifdef WORD64_AVAILABLE - typedef word64 TimerWord; +#ifdef HIGHRES_TIMER_AVAILABLE + #ifdef WORD64_AVAILABLE + typedef word64 TimerWord; + #else + typedef word32 TimerWord; + #endif #else - typedef word32 TimerWord; + #include <time.h> + typedef clock_t TimerWord; #endif //! _ -class TimerBase +class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TimerBase { public: enum Unit {SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS}; @@ -44,10 +49,8 @@ public: TimerWord TicksPerSecond(); }; -#ifdef HIGHRES_TIMER_AVAILABLE - //! high resolution timer -class Timer : public TimerBase +class CRYPTOPP_DLL Timer : public TimerBase { public: Timer(Unit unit = TimerBase::SECONDS, bool stuckAtZero = false) : TimerBase(unit, stuckAtZero) {} @@ -55,8 +58,6 @@ public: TimerWord TicksPerSecond(); }; -#endif // HIGHRES_TIMER_AVAILABLE - NAMESPACE_END #endif |