|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, make the function that wastes user time keep track of how much
processor time has been used so far, and make the function that wastes
system time track overall wall time. This is to minimize the number
of "overhead" system calls, which can tamper with our measurements.
Second, make the loop of the function that wastes user time more costly
so that modern processors don't run it too fast. Otherwise, the overhead
to track used time becomes significant in system time and makes our
tests fail.
This should fix the flakiness observed in our process-wrapper tests
when run on the modern CPUs that the iMac Pros carry.
Tested: I haven't been able to reproduce the flakiness. Running the
spend_cpu_time binary by hand reports very accurate timings for both
system and user time, even when pausing the program while it runs.
RELNOTES: None.
PiperOrigin-RevId: 204264910
|