--cpu-prof


稳定性: 1 - 实验

启动时开始 V8 CPU 分析器,并且在退出前将 CPU 分析文件写入磁盘。

$ node --cpu-prof index.js
$ ls *.cpuprofile
CPU.20190409.202950.15293.0.0.cpuprofile

Stability: 1 - Experimental

Starts the V8 CPU profiler on start up, and writes the CPU profile to disk before exit.

If --cpu-prof-dir is not specified, the generated profile will be placed in the current working directory.

If --cpu-prof-name is not specified, the generated profile will be named CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile.

$ node --cpu-prof index.js
$ ls *.cpuprofile
CPU.20190409.202950.15293.0.0.cpuprofile