Performance
Note: performance.now() currently uses Date.now() internally, providing
millisecond resolution. A future version may use the Switch's svcGetSystemTick
for sub-millisecond precision once a native binding is available.
See
https://developer.mozilla.org/docs/Web/API/Performance_API
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
timeOrigin | readonly | number | See https://developer.mozilla.org/docs/Web/API/Performance/timeOrigin |
Methods
clearMarks()
clearMarks(markName?): void
Parameters
| Parameter | Type |
|---|---|
markName? | string |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Performance/clearMarks
clearMeasures()
clearMeasures(measureName?): void
Parameters
| Parameter | Type |
|---|---|
measureName? | string |
Returns
void
See
https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures
getEntries()
getEntries(): PerformanceEntry[]
Returns
See
https://developer.mozilla.org/docs/Web/API/Performance/getEntries
getEntriesByName()
getEntriesByName(name, type?): PerformanceEntry[]
Parameters
| Parameter | Type |
|---|---|
name | string |
type? | string |
Returns
See
https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName
getEntriesByType()
getEntriesByType(type): PerformanceEntry[]
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
See
https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType
mark()
mark(markName, markOptions?): PerformanceMark
Creates a named PerformanceMark in the performance timeline.
Parameters
| Parameter | Type |
|---|---|
markName | string |
markOptions? | object |
markOptions.detail? | unknown |
markOptions.startTime? | number |
Returns
See
https://developer.mozilla.org/docs/Web/API/Performance/mark
measure()
measure(measureName, startOrMeasureOptions?, endMark?): PerformanceMeasure
Creates a named PerformanceMeasure between two marks or timestamps.
Parameters
| Parameter | Type |
|---|---|
measureName | string |
startOrMeasureOptions? | string | object |
endMark? | string |
Returns
See
https://developer.mozilla.org/docs/Web/API/Performance/measure
now()
now(): number
Returns the number of milliseconds elapsed since timeOrigin.
Returns
number
See
https://developer.mozilla.org/docs/Web/API/Performance/now
toJSON()
toJSON(): object
Returns
object
| Name | Type |
|---|---|
timeOrigin | number |
See
https://developer.mozilla.org/docs/Web/API/Performance/toJSON