查看一段代码的执行时间
程序员文章站
2024-01-22 12:21:04
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");
还有别的方法的话欢迎赐教