You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Process::TotalProcessorTime is about 42 times lower than expected on ARM64 Mac #91958
This program should output about 22 hours in the first line, and some nonsensical value in the second line.
Actual behavior
00:00:32.3739259
00:22:39.7048878
Regression?
No response
Known Workarounds
Multiply the result by 42 on ARM64 Mac :)
Configuration
Macbook Pro M2 Max, ARM64
.NET SDK 7.0.202
Other information
This is not the first time this API behaves problematically on macOS. The previous fix was dotnet/corefx#37637
I suspect that the fix was incorrect: in reality, we should call mach_timebase_info to get the coefficient to convert the value returned by the underlying API to nanoseconds, and apparently that value may be system-dependent.
Activity
adamsitnik commentedon Sep 13, 2023
Hi @ForNeVeR
Thank you for a detailed bug report. Since you have tracked down the issue, would you be also interested in sending a PR with a fix?
ForNeVeR commentedon Sep 13, 2023
Yep, sure, I'll try to get it done.
8 remaining items
Fix dotnet#91958: use mach_timebase_info to determine process time co…
(dotnet#91958) Process.OSX: fallback for non-zero exit code from mach…
(dotnet#91958) Process: move OSX-specific tests to a separate file
(dotnet#91958) Process.OSX: calculate times lazily
(dotnet#91958) Process: include string resources properly in tests
(dotnet#91958) Process: more overflow-safe logic
(dotnet#91958) Minimize diff
Fix #91958: use `mach_timebase_info` to determine process time coeffi…
Fix dotnet#91958: use mach_timebase_info to determine process time co…
[release/8.0-staging] Fix #91958: use mach_timebase_info to determine…