Skip to content

Commit

Permalink
fix: riscv64 build error
Browse files Browse the repository at this point in the history
  • Loading branch information
lichenggang committed Dec 14, 2024
1 parent 54fb54f commit ac7ac34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/time/timestamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ uint64_t Timestamp::rdts()
struct timeval tv;
gettimeofday(&tv, nullptr);
return static_cast<int64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
#elif defined(__mips__)
#elif defined(__mips__) || defined(__loongarch__) || defined(__riscv)
// mips apparently only allows rdtsc for superusers, so we fall back to gettimeofday.
// It's possible clock_gettime would be better.
struct timeval tv;
Expand Down

0 comments on commit ac7ac34

Please sign in to comment.