File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
third-party/benchmark/src Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,16 @@ inline BENCHMARK_ALWAYS_INLINE int64_t Now() {
228228 struct timeval tv;
229229 gettimeofday (&tv, nullptr );
230230 return static_cast <int64_t >(tv.tv_sec ) * 1000000 + tv.tv_usec ;
231+ #elif defined(__hppa__)
232+ // HP PA-RISC provides a user-readable clock counter (cr16), but
233+ // it's not syncronized across CPUs and only 32-bit wide when programs
234+ // are built as 32-bit binaries.
235+ // Use clock_gettime(CLOCK_MONOTONIC, ...) instead of gettimeofday
236+ // because is provides nanosecond resolution.
237+ // Initialize to always return 0 if clock_gettime fails.
238+ struct timespec ts = {0 , 0 };
239+ clock_gettime (CLOCK_MONOTONIC, &ts);
240+ return static_cast <int64_t >(ts.tv_sec ) * 1000000000 + ts.tv_nsec ;
231241#else
232242 // The soft failover to a generic implementation is automatic only for ARM.
233243 // For other platforms the developer is expected to make an attempt to create
You can’t perform that action at this time.
0 commit comments