Skip to content

Commit

Permalink
Merge pull request #41 from marxin/fix-get-time-for-targets
Browse files Browse the repository at this point in the history
Implement read_time for targets that do not support rdtsc insn.
  • Loading branch information
eeide committed Jun 4, 2017
2 parents 7b871ac + 2885f5c commit 30a3c86
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/platform.cpp
Expand Up @@ -83,6 +83,7 @@ static unsigned long long read_time(void)
return clk;
}
# else
# if defined (__i386__) || defined (__x86_64__)
static long long read_time(void)
{
long long l;
Expand All @@ -91,6 +92,13 @@ static long long read_time(void)
);
return l;
}
#else
#include <time.h>
static long long read_time(void) {
time_t t = time(NULL);
return t;
}
#endif
# endif
#endif // HAVE_ARC4RANDOM_BUF

Expand Down

0 comments on commit 30a3c86

Please sign in to comment.