diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-06-07 11:28:04 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-06-09 19:07:01 -0400 |
commit | 69e72ecda720d10308516366044952ddd6290e7e (patch) | |
tree | a349edc6aadb872a34f44aa2f98ddb202d9bc01e /hadrian | |
parent | 46d2fc65fd1eaf3284dc01a2fcebcef2cce4bee3 (diff) | |
download | haskell-69e72ecda720d10308516366044952ddd6290e7e.tar.gz |
getProcessCPUTime: Fix the getrusage fallback to account for system CPU time
clock_gettime reports the combined total or user AND system time so in
order to replicate it with getrusage we need to add both system and user
time together.
See https://stackoverflow.com/questions/7622371/getrusage-vs-clock-gettime
Some sample measurements when building Cabal with this patch
t1: rusage
t2: clock_gettime
t1: 62347518000; t2: 62347520873
t1: 62395687000; t2: 62395690171
t1: 62432435000; t2: 62432437313
t1: 62478489000; t2: 62478492465
t1: 62514990000; t2: 62514992534
t1: 62515479000; t2: 62515480327
t1: 62515485000; t2: 62515486344
Fixes #21656
Diffstat (limited to 'hadrian')
0 files changed, 0 insertions, 0 deletions