mirror of
https://github.com/google/benchmark.git
synced 2024-11-30 04:42:35 +00:00
Add support for new architecture loongarch (#1173)
This commit is contained in:
parent
342409126b
commit
f90215f1cc
|
@ -173,6 +173,10 @@ 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__)
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, nullptr);
|
||||||
|
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
|
||||||
#elif defined(__s390__) // Covers both s390 and s390x.
|
#elif defined(__s390__) // Covers both s390 and s390x.
|
||||||
// Return the CPU clock.
|
// Return the CPU clock.
|
||||||
uint64_t tsc;
|
uint64_t tsc;
|
||||||
|
|
Loading…
Reference in a new issue