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:
Zi Xuan Wu (Zeson) 2022-05-23 18:47:58 +08:00 committed by GitHub
parent 37be1e8252
commit 6c46c9f593
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;