查看一段代码的执行时间
程序员文章站
2022-05-03 10:33:51
var beginTime = +new Date(); this.$store.commit('EDIT_PROJECT', resp); this.$router.push(`/service/project/${id}`); var endTime = +new Date(); console ......
var beginTime = +new Date();
this.$store.commit('EDIT_PROJECT', resp);
this.$router.push(`/service/project/${id}`);
var endTime = +new Date();
console.log("用时共计"+(endTime-beginTime)+"ms");
还有别的方法的话欢迎赐教