| 24 | #include <openssl/rand.h> |
| 25 | |
| 26 | static inline int64_t GetPerformanceCounter() |
| 27 | { |
| 28 | int64_t nCounter = 0; |
| 29 | #ifdef WIN32 |
| 30 | QueryPerformanceCounter((LARGE_INTEGER*)&nCounter); |
| 31 | #else |
| 32 | timeval t; |
| 33 | gettimeofday(&t, NULL); |
| 34 | nCounter = (int64_t)(t.tv_sec * 1000000 + t.tv_usec); |
| 35 | #endif |
| 36 | return nCounter; |
| 37 | } |
| 38 | |
| 39 | void RandAddSeed() |
| 40 | { |