First, you compile the program using "-pg" option:
$ gcc -pg -o a.out test.cc
or
$ g++ -pg -o a.out test.cpp
Then run the program:
$ a.out
This will generate a file "gmon.out". We will use gprof to view it:
$ gprof a.out gmon.out
Read the man page of gprof to understand the output.
Recent comments
3 weeks 2 days ago
4 weeks 3 days ago
8 weeks 16 hours ago
33 weeks 1 day ago
34 weeks 2 hours ago
44 weeks 6 days ago
46 weeks 2 days ago
1 year 2 weeks ago
1 year 3 weeks ago
1 year 4 weeks ago