How to measure code execution time in VBScript or JavaScript?

前端 未结 7 1618
野趣味
野趣味 2020-12-06 05:23

What is a good way to measure code execution time in VBScript?

Or failing that how to do it in JavaScript?

7条回答
  •  [愿得一人]
    2020-12-06 05:54

    This is a great article on JavaScript timing, from the book "Even Faster Websites". Two things to keep in mind are that JavaScript Date objects often have a resolution as big as 15ms (this varies by browser and operating system), and most profilers have an observer effect. Note that Google Speed Tracer (new since the article was published) runs out of process and collects data asynchronously to minimize the observer effect.

提交回复
热议问题