mirror of
https://github.com/google/benchmark.git
synced 2024-11-28 05:44:40 +00:00
Add support to get clock for new architecture CSKY (#1400)
it's like what loongarch does to get cycle clock for CSKY by gettimeofday function.
This commit is contained in:
parent
37be1e8252
commit
6c46c9f593
|
@ -173,7 +173,7 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, nullptr);
|
gettimeofday(&tv, nullptr);
|
||||||
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
|
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
|
||||||
#elif defined(__loongarch__)
|
#elif defined(__loongarch__) || defined(__csky__)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, nullptr);
|
gettimeofday(&tv, nullptr);
|
||||||
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
|
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
|
||||||
|
|
Loading…
Reference in a new issue