fix(docs): refresh documentation and test timing tolerances for updated APIs
This commit is contained in:
@@ -170,8 +170,8 @@ tap.test('HrtMeasurement should capture accurate timing', async (tools) => {
|
||||
|
||||
measurement.stop();
|
||||
|
||||
// Should be at least 50ms
|
||||
expect(measurement.milliSeconds).toBeGreaterThanOrEqual(50);
|
||||
// Timers can resolve slightly below the requested delay due to sub-ms rounding.
|
||||
expect(measurement.milliSeconds).toBeGreaterThanOrEqual(45);
|
||||
// But not too much more (allow for some overhead)
|
||||
expect(measurement.milliSeconds).toBeLessThan(100);
|
||||
});
|
||||
@@ -192,13 +192,13 @@ tap.test('multiple timing measurements should be independent', async (tools) =>
|
||||
await tools.delayFor(25);
|
||||
measurement2.stop();
|
||||
|
||||
// measurement1 should be ~50ms (25ms + 25ms)
|
||||
expect(measurement1.milliSeconds).toBeGreaterThanOrEqual(50);
|
||||
// measurement1 should be ~50ms (25ms + 25ms), allowing minor timer jitter.
|
||||
expect(measurement1.milliSeconds).toBeGreaterThanOrEqual(45);
|
||||
expect(measurement1.milliSeconds).toBeLessThan(70);
|
||||
|
||||
// measurement2 should be ~50ms (25ms + 25ms)
|
||||
expect(measurement2.milliSeconds).toBeGreaterThanOrEqual(50);
|
||||
// measurement2 should be ~50ms (25ms + 25ms), allowing minor timer jitter.
|
||||
expect(measurement2.milliSeconds).toBeGreaterThanOrEqual(45);
|
||||
expect(measurement2.milliSeconds).toBeLessThan(70);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
tap.start();
|
||||
|
||||
Reference in New Issue
Block a user