Profiler: stop()-Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Please take two minutes to fill out our short survey.
Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.
Die stop()
-Methode der Profiler
-Schnittstelle stoppt den Profiler und gibt ein Promise
zurück, das das Profil selbst auflöst.
Syntax
stop()
Parameter
Keine.
Rückgabewert
Ein Promise
, das in ein Objekt aufgelöst wird, welches die Profildaten enthält. Das Format und die Interpretation dieses Objekts wird in Profilaufbau und Format beschrieben.
Beispiele
Ein Profil aufzeichnen
Der folgende Code profiliert die doWork()
-Operation und protokolliert das Ergebnis.
const profiler = new Profiler({ sampleInterval: 10, maxBufferSize: 10000 });
doWork();
const profile = await profiler.stop();
console.log(JSON.stringify(profile));
Spezifikationen
Specification |
---|
JS Self-Profiling API # dom-profiler-stop |