1,包含头文件gperftools/profiler.h

2,代码结构如下:

int main()
{
    // codes
    ProfilerStart("./profile");
    // working...
    ProfilerStop();
}

3,程序运行完之后,会在本地生成一个名为profile的文件

4,运行下面的命令即可看出简单的评测图

pprof --text programeName profile

 更复杂的操作看pprof的help信息。

相关文章:

  • 2022-12-23
  • 2021-12-13
  • 2022-01-05
  • 2022-12-23
  • 2021-09-14
  • 2021-12-15
  • 2021-05-01
猜你喜欢
  • 2021-07-24
  • 2021-06-03
  • 2022-02-15
  • 2021-12-19
  • 2021-04-24
  • 2021-10-29
相关资源
相似解决方案