Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
gprof example 2: profiling a simple console application in Qt Creator, using Qt project file
This example shows how to use gprof under Qt Creator to profile a simple console application.
To be able to use gprof to profile a project, add the following lines to a Qt project file:
QMAKE_CXXFLAGS_DEBUG += -pg |
then, for a terminal, type the following lines:
qmake -config debug |
Or easier, run the script profile.sh:
./profile.sh |
Operating system(s) or programming environment(s)
Lubuntu 11.04 (natty)
Qt Creator 2.0.1Libraries used:
STL: GNU ISO C++ Library, version 4.5.2
#------------------------------------------------- |
#include <algorithm> |
#!/bin/sh |
Here I show the results comparing the five functions, copied from the results file:
Each sample counts as 0.01 seconds. |
Conclusion: as expected, SortVector (a QuickSort) is by far the quickest sorting algorithm.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.