Web APIs

PerformanceObserver.disconnect()

Try the free JavaScript compiler

Stop observing entry types and empty the observer buffer. Existing timeline entries are separate from that buffer. Example console output: 0.

Formal Syntax & Structure

javascript syntaxjavascript
observer.disconnect()

Return Value

undefined

No result value.

Working Example

Example Snippetjavascript
const o=new PerformanceObserver(()=>{}); o.observe({entryTypes:["mark"]}); performance.mark("x"); o.disconnect(); console.log(o.takeRecords().length);
JavaScript Reference