function add(){
          //这里放要执行的代码
    }
//开始测试并输出
        function test()
        {
        var start=new Date().getTime();
        add();
        var end=new Date().getTime();
        return (end-start)+"ms";
        }
        var time=test(add);
        alert(time);

 

相关文章:

  • 2021-09-26
  • 2022-02-06
  • 2021-12-16
  • 2022-01-04
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-08
相关资源
相似解决方案