Skip to content

Commit

Permalink
fix per-thread timing error on z/OS (#1719)
Browse files Browse the repository at this point in the history
Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
  • Loading branch information
abhina-sree and dmah42 authored Jan 4, 2024
1 parent c213e41 commit e3824e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/timers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e3824e7

Please sign in to comment.