1
0
Fork 0
firefox/testing/web-platform/tests/js-self-profiling/time-domain.window.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

19 lines
533 B
JavaScript

// META: script=resources/profile-utils.js
promise_test(async () => {
const start = performance.now();
const profiler = new Profiler({
sampleInterval: 10,
maxBufferSize: Number.MAX_SAFE_INTEGER,
});
ProfileUtils.forceSample();
const trace = await profiler.stop();
const end = performance.now();
assert_greater_than(trace.samples.length, 0);
for (const sample of trace.samples) {
assert_between_inclusive(sample.timestamp, start, end);
}
}, 'sample timestamps use the current high-resolution time');