clocks suck
This commit is contained in:
@ -24,14 +24,7 @@ TEST_CASE("OSAL::Clock Test", "[OSAL::Clock Test]") {
|
||||
// We require timeOfDayAsTimeval to be larger than time as it
|
||||
// was request a few ns later
|
||||
double difference = timevalOperations::toDouble(timeOfDayAsTimeval - time);
|
||||
uint32_t ticksPerSecond =Clock:: getTicksPerSecond();
|
||||
float secondPerTick = 0;
|
||||
if (ticksPerSecond != 0){
|
||||
secondPerTick = 1.0 / ticksPerSecond;
|
||||
}
|
||||
// In rtems, timevals have microsecond resolution, while TOD has only tick resolution, leading to
|
||||
// negative differences when comparing "equal" times
|
||||
CHECK(difference >= -secondPerTick);
|
||||
CHECK(difference >= 0);
|
||||
CHECK(difference <= 0.005);
|
||||
|
||||
// Conversion in the other direction
|
||||
|
Reference in New Issue
Block a user