Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. PerformanceScriptTiming

PerformanceScriptTiming

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

ThePerformanceScriptTiming interface is specified in the Long Animation Frames API and provides metrics on individual scripts that contribute to long animation frames (LoAFs).

Description

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 causingjanky (non-smooth) animated effects and scrolling. This often leads to user frustration.

ThePerformanceScriptTiming interface (instances of which are accessed via thePerformanceLongAnimationFrameTiming.scripts property) provides the following granular set of information on individual scripts that contribute to LoAFs, allowing developers to narrow down their root causes:

  • A detailed set of timestamps for each script.
  • The identity and type of the invoker, i.e., the feature that, when invoked, ran the script.
  • Detailed information on each script source file, including the URL, and the function name and character position that contributed to the LoAF.

PerformanceScriptTiming inherits fromPerformanceEntry.

PerformanceEntry PerformanceScriptTiming

Instance properties

This interface extends the followingPerformanceEntry properties for long animation frame performance entries:

PerformanceEntry.durationRead onlyExperimental

Returns aDOMHighResTimeStamp representing the elapsed time in milliseconds between the start and end of the script's execution.

PerformanceEntry.entryTypeRead onlyExperimental

Returns the entry type, which is always"script".

PerformanceEntry.nameRead onlyExperimental

Returns the entry name, which is always"script".

PerformanceEntry.startTimeRead onlyExperimental

Returns aDOMHighResTimeStamp representing the time when the script execution started, in milliseconds.

This interface also supports the following properties:

PerformanceScriptTiming.executionStartRead onlyExperimental

Returns aDOMHighResTimeStamp indicating the time when the script compilation finished and execution started.

PerformanceScriptTiming.forcedStyleAndLayoutDurationRead onlyExperimental

Returns aDOMHighResTimeStamp indicating the total time spent, in milliseconds, by the script processing forced layout/style. SeeAvoid layout thrashing to understand what causes this.

PerformanceScriptTiming.invokerRead onlyExperimental

Returns a string value indicating the identity of the feature that, when invoked, ran the script.

PerformanceScriptTiming.invokerTypeRead onlyExperimental

Returns a string value indicating the type of feature that, when invoked, ran the script.

PerformanceScriptTiming.pauseDurationRead onlyExperimental

Returns aDOMHighResTimeStamp indicating the total time, in milliseconds, spent by the script on "pausing" synchronous operations (for example,Window.alert() calls or synchronousXMLHttpRequests).

PerformanceScriptTiming.sourceCharPositionRead onlyExperimental

Returns a number representing the script character position of the script feature that contributed to the LoAF.

PerformanceScriptTiming.sourceFunctionNameRead onlyExperimental

Returns a string representing the name of the function that contributed to the LoAF.

PerformanceScriptTiming.sourceURLRead onlyExperimental

Returns a string representing the URL of the script.

PerformanceScriptTiming.windowRead onlyExperimental

Returns a reference to aWindow object representing thewindow of the container (i.e., either the top-level document or an<iframe>) in which the LoAF-causing script was executed.

PerformanceScriptTiming.windowAttributionRead onlyExperimental

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.

Instance methods

PerformanceScriptTiming.toJSON()Experimental

Returns a JSON representation of thePerformanceScriptTiming object.

Examples

SeeLong animation frame timing for examples related to the Long Animation Frames API.

Specifications

Specification
Long Animation Frames API
# sec-PerformanceScriptTiming

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp