Profiler: stop()-Methode

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
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

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

js
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

Browser-Kompatibilität