Is console.time() safe in node.js?

前端 未结 3 1548
半阙折子戏
半阙折子戏 2021-02-01 06:40

I have a little snippet of node.js code in front of me that looks like this:

console.time(\"queryTime\");
doAsyncIOBoundThing(function(err, results) {
    consol         


        
3条回答
  •  灰色年华
    2021-02-01 07:34

    Consider new NodeJS features as it has evolved too. Please look into:

    process.hrtime() & NodeJS's other performance API hooks:

    https://nodejs.org/api/perf_hooks.html#perf_hooks_performance_timing_api

提交回复
热议问题