Inspect the performance timeline
Quick answer
The performance timeline contains entries with names, entry types, start times and durations. Read snapshots for inspection; not every entry type is exposed by the synchronous retrieval methods.
How it works
performance.getEntriesByType("mark") retrieves currently buffered marks. performance.getEntriesByName(name, type) filters by name and optionally entry type. Entries are ordered by startTime, not necessarily insertion order. The returned array is a snapshot; later entries do not automatically appear in it. Use PerformanceObserver for supported types that require observation. Clear application marks and measures when no longer needed. Resource timing can expose restricted or incomplete cross-origin data, so do not infer full network behavior from missing fields.
Local examples
Run in a fresh browser document with local synthetic data. Actual ByteMind editor support is unverified.
(async () => {performance.mark("late",{startTime:20});performance.mark("early",{startTime:5});console.log(performance.getEntriesByType("mark").map(x=>x.name).join(","));performance.clearMarks("late");performance.clearMarks("early");})()Expected console output:
early,lateThe chronological order differs from insertion order.
Run in a fresh browser document with local synthetic data. Actual ByteMind editor support is unverified.
(async () => {performance.mark("same",{startTime:2});const first=performance.getEntriesByName("same","mark");performance.mark("same",{startTime:3});console.log(first.length,performance.getEntriesByName("same","mark").length);performance.clearMarks("same");})()Expected console output:
1 2The earlier array does not grow when another entry is added.
Common mistakes
Do not assume getEntries returns every observer-only entry or interpret an empty result as proof no activity occurred.
Practice
Create three marks at explicit times in reverse insertion order. Filter by type and verify chronological order.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Inspect the performance timeline — Knowledge Check
Apply the concept and reason about local example output.
How are matching timeline entries ordered?
Does a returned timeline array update automatically?
What can an empty synchronous timeline query mean?
What is the exact console output in Inspect the performance timeline example 1?
(async () => {performance.mark("late",{startTime:20});performance.mark("early",{startTime:5});console.log(performance.getEntriesByType("mark").map(x=>x.name).join(","));performance.clearMarks("late");performance.clearMarks("early");})()What is the exact console output in Inspect the performance timeline example 2?
(async () => {performance.mark("same",{startTime:2});const first=performance.getEntriesByName("same","mark");performance.mark("same",{startTime:3});console.log(first.length,performance.getEntriesByName("same","mark").length);performance.clearMarks("same");})()