performance.markResourceTiming(timingInfo, requestedUrl, initiatorType, global, cacheMode)


此属性是 Node.js 的扩展。 它在 Web 浏览器中不可用。

在资源时间线中创建新的 PerformanceResourceTiming 条目。 PerformanceResourceTimingPerformanceEntry 的子类,其 performanceEntry.entryType 始终是 'resource'。 性能资源用于在资源时间线中标记时刻。

创建的 PerformanceMark 条目放入全局资源时间线,可以使用 performance.getEntriesperformance.getEntriesByNameperformance.getEntriesByType 查询。 当执行观察时,应使用 performance.clearResourceTimings 手动从全局的性能时间轴中清除条目。

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.