console.timeEnd()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

console.timeEnd() は、以前 console.time() の呼び出しで開始したタイマーを停止します。

詳細や使用例については、ドキュメントのタイマーを参照して下さい。

メモ: この機能はウェブワーカー内で利用可能です。

構文

js
timeEnd(label);

引数

label

停止するタイマーの名前です。停止させると、経過時間が自動的にウェブコンソールに停止した時刻を示すインジケーターと共に表示されます。

返値

なし (undefined)。

js
console.time("answer time");
alert("Click to continue");
console.timeLog("answer time");
alert("Do a bunch of other stuff…");
console.timeEnd("answer time");

上記の例の出力結果は、ユーザーが最初のアラートボックスを解除するのにかかった時間と、その後に 2 番目のアラートを解除するのにかかった時間を示します。

タイマーの名前は timeLog() を使ってタイマーの値を記録するときに表示され、停止するときに再び表示されることに注意してください。さらに、 timeEnd() の呼び出しは、タイマーが時間を追跡しなくなったことを明確にするために、 "timer ended" という追加の情報を持っています。

仕様書

Specification
Console
# timeend

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
timeEnd() static method

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support