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


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

🌐 This property is an extension by Node.js. It is not available in Web browsers.

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

🌐 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.

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

🌐 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.