[JavaScript] How to Simply Measure Execution Time in Milliseconds

Tadashi Shigeoka ·  Thu, September 6, 2012

Memo of a JavaScript snippet to simply measure execution time in milliseconds.

var start = new Date();
// Process you want to measure execution time for
var end = new Date();
var executionTime = end.getTime() - start.getTime();

console.log(executionTime);

【Reference】

JavaScriptでページのレンダリング時間をミリ秒単位で簡易計測する - 大人になったら肺呼吸

That’s all from the Gemba.