Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,11 @@ public unsafe void TestTotalProcessorTimeMacOs()

void AssertTime(TimeSpan managed, TimeSpan native, string label)
{
const double ToleranceInMicroseconds = 20;
double differenceUs = (managed - native).TotalMicroseconds;
Assert.True(
managed >= native,
$"Time '{label}' returned by managed API ({managed}) should be greated or equal to the time returned by native API ({native}).");
differenceUs >= -ToleranceInMicroseconds,
$"Time '{label}' returned by managed API ({managed}) should be greater or equal to the time returned by native API ({native}) within a tolerance of {ToleranceInMicroseconds} μs.");
}
}

Expand Down
Loading