This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The PerformanceScriptTiming interface is specified in the Long Animation Frames API and provides metrics on individual scripts that contribute to long animation frames (LoAFs).
Long animation frames (LoAFs) are rendering updates that are delayed beyond 50ms. LoAFs can result in slow user interface (UI) updates, making controls appear unresponsive and causing janky (non-smooth) animated effects and scrolling. This often leads to user frustration.
The PerformanceScriptTiming interface (instances of which are accessed via the PerformanceLongAnimationFrameTiming.scripts property) provides the following granular set of information on individual scripts that contribute to LoAFs, allowing developers to narrow down their root causes:
PerformanceScriptTiming inherits from PerformanceEntry.
This interface extends the following PerformanceEntry properties for long animation frame performance entries:
PerformanceEntry.duration Read only Experimental
Returns a DOMHighResTimeStamp representing the elapsed time in milliseconds between the start and end of the script's execution.
PerformanceEntry.entryType Read only Experimental
Returns the entry type, which is always "script".
PerformanceEntry.name Read only Experimental
Returns the entry name, which is always "script".
PerformanceEntry.startTime Read only Experimental
Returns a DOMHighResTimeStamp representing the time when the script execution started, in milliseconds.
This interface also supports the following properties:
PerformanceScriptTiming.executionStart Read only Experimental
Returns a DOMHighResTimeStamp indicating the time when the script compilation finished and execution started.
PerformanceScriptTiming.forcedStyleAndLayoutDuration Read only Experimental
Returns a DOMHighResTimeStamp indicating the total time spent, in milliseconds, by the script processing forced layout/style. See Avoid layout thrashing to understand what causes this.
PerformanceScriptTiming.invoker Read only Experimental
Returns a string value indicating the identity of the feature that, when invoked, ran the script.
PerformanceScriptTiming.invokerType Read only Experimental
Returns a string value indicating the type of feature that, when invoked, ran the script.
PerformanceScriptTiming.pauseDuration Read only Experimental
Returns a DOMHighResTimeStamp indicating the total time, in milliseconds, spent by the script on "pausing" synchronous operations (for example, Window.alert() calls or synchronous XMLHttpRequests).
PerformanceScriptTiming.sourceCharPosition Read only Experimental
Returns a number representing the script character position of the script feature that contributed to the LoAF.
PerformanceScriptTiming.sourceFunctionName Read only Experimental
Returns a string representing the name of the function that contributed to the LoAF.
PerformanceScriptTiming.sourceURL Read only Experimental
Returns a string representing the URL of the script.
PerformanceScriptTiming.window Read only Experimental
Returns a reference to a Window object representing the window of the container (i.e., either the top-level document or an <iframe>) in which the LoAF-causing script was executed.
PerformanceScriptTiming.windowAttribution Read only Experimental
Returns an enumerated value describing the relationship of the container (i.e., either the top-level document or an <iframe>) in which the LoAF-causing script was executed, relative to the window running the current document.
PerformanceScriptTiming.toJSON() Experimental
Returns a JSON representation of the PerformanceScriptTiming object.
See Long animation frame timing for examples related to the Long Animation Frames API.
| Specification |
|---|
| Long Animation Frames API> # sec-PerformanceScriptTiming> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
PerformanceScriptTiming |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
executionStart |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
forcedStyleAndLayoutDuration |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
invoker |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
invokerType |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
pauseDuration |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
sourceCharPosition |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
sourceFunctionName |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
sourceURL |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
toJSON |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
window |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
windowAttribution |
123 | 123 | No | 109 | No | 123 | No | 82 | No | 27.0 | 123 | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceScriptTiming