1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-30 06:50:27 +08:00

fix per-thread timing error on z/OS ()

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
This commit is contained in:
Abhina Sree 2024-01-04 06:07:01 -05:00 committed by GitHub
parent c213e41eb9
commit e3824e7503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,6 +182,9 @@ double ThreadCPUUsage() {
// RTEMS doesn't support CLOCK_THREAD_CPUTIME_ID. See
// https://github.com/RTEMS/rtems/blob/master/cpukit/posix/src/clockgettime.c
return ProcessCPUUsage();
#elif defined(BENCHMARK_OS_ZOS)
// z/OS doesn't support CLOCK_THREAD_CPUTIME_ID.
return ProcessCPUUsage();
#elif defined(BENCHMARK_OS_SOLARIS)
struct rusage ru;
if (getrusage(RUSAGE_LWP, &ru) == 0) return MakeTime(ru);