Skip to content

Commit

Permalink
Use cntvct_el0 to get time in utf_converters/performance test case on…
Browse files Browse the repository at this point in the history
… ARM64
  • Loading branch information
k15tfu committed Apr 9, 2020
1 parent c310e45 commit 5a3c0aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/utf_converters_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,12 @@ uint64_t get_time() throw()
#endif
);
return static_cast<uint64_t>(hi) << 32 | lo;
#elif defined(__aarch64__)
uint64_t cntvct_el0;
asm volatile(
"mrs %0, cntvct_el0\n\t"
: "=r" (cntvct_el0) : : );
return cntvct_el0;
#else
#error Unsupported architecture
#endif
Expand Down

0 comments on commit 5a3c0aa

Please sign in to comment.