📜  Javascript 测量函数运行时间 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:31.535000             🧑  作者: Mango

代码示例1
var startTime = performance.now();

alert('Run some function here');

var endTime = performance.now();
var totalTime=endTime-startTime;// time took to run in milliseconds

alert('Total time:'+totalTime +'ms');