How do I measure the execution time of JavaScript code with callbacks?

前端 未结 10 1513
臣服心动
臣服心动 2020-11-30 16:28

I have a piece of JavaScript code that I am executing using the node.js interpreter.

for(var i = 1; i <         


        
10条回答
  •  旧时难觅i
    2020-11-30 17:01

    I had same issue while moving from AWS to Azure

    For express & aws, you can already use, existing time() and timeEnd()

    For Azure, use this: https://github.com/manoharreddyporeddy/my-nodejs-notes/blob/master/performance_timers_helper_nodejs_azure_aws.js

    These time() and timeEnd() use the existing hrtime() function, which give high-resolution real time.

    Hope this helps.

提交回复
热议问题