time-domain.window.js (533B)
1 // META: script=resources/profile-utils.js 2 3 promise_test(async () => { 4 const start = performance.now(); 5 6 const profiler = new Profiler({ 7 sampleInterval: 10, 8 maxBufferSize: Number.MAX_SAFE_INTEGER, 9 }); 10 ProfileUtils.forceSample(); 11 const trace = await profiler.stop(); 12 13 const end = performance.now(); 14 15 assert_greater_than(trace.samples.length, 0); 16 for (const sample of trace.samples) { 17 assert_between_inclusive(sample.timestamp, start, end); 18 } 19 }, 'sample timestamps use the current high-resolution time');