Measure duration between two marks
Creates a performance measure between two named marks and returns the duration.
Name for the measure
Start mark name
End mark name
Duration in milliseconds or null if measurement failed
markPerformance('fetch-start');await fetchData();markPerformance('fetch-end');const duration = measurePerformance('data-fetch', 'fetch-start', 'fetch-end');console.log('Fetch took:', duration, 'ms'); Copy
markPerformance('fetch-start');await fetchData();markPerformance('fetch-end');const duration = measurePerformance('data-fetch', 'fetch-start', 'fetch-end');console.log('Fetch took:', duration, 'ms');
Measure duration between two marks
Creates a performance measure between two named marks and returns the duration.