microsoft-authentication-library-for-dotnet icon indicating copy to clipboard operation
microsoft-authentication-library-for-dotnet copied to clipboard

MeasureDurationResult incorrect when running in linux

Open SingleCopy opened this issue 1 year ago • 3 comments

Fixes: #4784

Changes proposed in this request The MeasureDurationResult time calculations do not work when running in linux as the Stopwatch.Frequency is not taken into account. This change correctly calculates the Milliseconds and Microseconds by taking the Stopwatch.Frequency into account.

Testing Difficult without running the tests on different O/S

Performance impact N/A

Documentation N/A

SingleCopy avatar May 23 '24 15:05 SingleCopy

This is a very good catch @SingleCopy . I found some mention about this here: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stopwatch.elapsedticks?view=net-8.0&redirectedfrom=MSDN#System_Diagnostics_Stopwatch_ElapsedTicks

@GeoK - I think this code is common with our other SDKs

bgavrilMS avatar May 23 '24 15:05 bgavrilMS

CC @jennyf19 as I believe this code was copied from MISE. Also adding @pmaytak for a review

bgavrilMS avatar May 25 '24 08:05 bgavrilMS

@microsoft-github-policy-service agree

SingleCopy avatar May 28 '24 15:05 SingleCopy

@neha-bhargava - please review this PR. There may be implications in how we interpret some of our telemetry.

bgavrilMS avatar May 28 '24 18:05 bgavrilMS