performance.markResourceTiming(timingInfo, requestedUrl, initiatorType, global, cacheMode)
timingInfo
<Object> 获取计时信息requestedUrl
<string> 资源网址initiatorType
<string> 启动器名称,例如:'fetch'global
<Object>cacheMode
<string> 缓存模式必须为空字符串('')或 'local'
此属性是 Node.js 的扩展。 它在 Web 浏览器中不可用。
在资源时间线中创建新的 PerformanceResourceTiming
条目。
PerformanceResourceTiming
是 PerformanceEntry
的子类,其 performanceEntry.entryType
始终是 'resource'
。
性能资源用于在资源时间线中标记时刻。
创建的 PerformanceMark
条目放入全局资源时间线,可以使用 performance.getEntries
、performance.getEntriesByName
、performance.getEntriesByType
查询。
当执行观察时,应使用 performance.clearResourceTimings
手动从全局的性能时间轴中清除条目。
timingInfo
<Object> Fetch Timing InforequestedUrl
<string> The resource urlinitiatorType
<string> The initiator name, e.g: 'fetch'global
<Object>cacheMode
<string> The cache mode must be an empty string ('') or 'local'
This property is an extension by Node.js. It is not available in Web browsers.
Creates a new PerformanceResourceTiming
entry in the Resource Timeline. A
PerformanceResourceTiming
is a subclass of PerformanceEntry
whose
performanceEntry.entryType
is always 'resource'
. Performance resources
are used to mark moments in the Resource Timeline.
The created PerformanceMark
entry is put in the global Resource Timeline
and can be queried with performance.getEntries
,
performance.getEntriesByName
, and performance.getEntriesByType
. When the
observation is performed, the entries should be cleared from the global
Performance Timeline manually with performance.clearResourceTimings
.