Performance.idl 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. #import <DOM/EventTarget.idl>
  2. #import <HighResolutionTime/DOMHighResTimeStamp.idl>
  3. #import <NavigationTiming/PerformanceTiming.idl>
  4. #import <PerformanceTimeline/PerformanceEntry.idl>
  5. #import <UserTiming/PerformanceMark.idl>
  6. #import <UserTiming/PerformanceMeasure.idl>
  7. // https://www.w3.org/TR/performance-timeline/#dom-performanceentrylist
  8. typedef sequence<PerformanceEntry> PerformanceEntryList;
  9. // https://w3c.github.io/hr-time/#sec-performance
  10. [Exposed=(Window, Worker)]
  11. interface Performance : EventTarget {
  12. DOMHighResTimeStamp now();
  13. readonly attribute DOMHighResTimeStamp timeOrigin;
  14. readonly attribute PerformanceTiming timing;
  15. // https://w3c.github.io/user-timing/#extensions-performance-interface
  16. // "User Timing" extensions to the Performance interface
  17. PerformanceMark mark(DOMString markName, optional PerformanceMarkOptions markOptions = {});
  18. undefined clearMarks(optional DOMString markName);
  19. PerformanceMeasure measure(DOMString measureName, optional (DOMString or PerformanceMeasureOptions) startOrMeasureOptions = {}, optional DOMString endMark);
  20. undefined clearMeasures(optional DOMString measureName);
  21. // https://www.w3.org/TR/performance-timeline/#extensions-to-the-performance-interface
  22. // "Performance Timeline" extensions to the Performance interface
  23. PerformanceEntryList getEntries();
  24. PerformanceEntryList getEntriesByType(DOMString type);
  25. PerformanceEntryList getEntriesByName(DOMString name, optional DOMString type);
  26. };