JS Built-ins
performanceadvanced

performance β€” getEntriesByName after mark

πŸ“– Usage Example
const entries = performance.getEntriesByName('task')
entries[0].duration  // β†’ elapsed ms

getEntriesByName() retrieves the duration of a specific named performance measure.

performance.getEntriesByName()

After calling performance.mark(name), the entry is retrievable via performance.getEntriesByName(name).

Challenge: Verify that getEntriesByName returns exactly one entry after a single mark.

πŸ’‘ Hints (1)
  • β€’ Always clearMarks before marking in tests to prevent entries accumulating across runs