What profiler should I use to measure _real_ time (including waiting for syscalls) spend in this function, not _CPU_ one

前端 未结 2 900
Happy的楠姐
Happy的楠姐 2021-01-21 02:52

The application does not calculate things, but does i/o, read files, uses network. I want profiler to show it.

I expect something like something like in callgrind that c

2条回答
  •  無奈伤痛
    2021-01-21 03:28

    There's no real way to answer that question without knowing your platform and a little more about what you are trying to do.

    When I'm running on an Intel platform, I like to use the Time Stamp Counter (RDTSC). It is tough to beat resoultion in the sub-microsecond range. I just put a call to it before and after a chunk of code, and compare the difference.

提交回复
热议问题