title: Profiling a C++ project in terms of execution time
body: <p>I need some help in terms of profiling existing code in terms of execution time. The intention is to speed it up.</p>
  
  <p>I've been given some code that was worked on previously. It is completely written in C++ with OO concepts. There is a GUI based interface to it, and selecting a certain option runs selected peiece of code. (There are about 11 classes as part of the project).</p>
  
  <p>I want to be able to press a GUI option and let the code run and generate a resource map like:</p>
  
  <pre><code>Functions of Class 1 = 20% of execution time
  Functions of Class 2 = 60% of execution time
  Functions of Class 3 = 10% of execution time
  Functions of Class 4 = 10% of execution time
  </code></pre>
  
  <p>That way, I know which class is taking up the most time and then know which to work on and improve. However, I have no idea how to go about doing this. I only have basic C++ knowledge.</p>
  
  <p>I did read this post: <a href="https://stackoverflow.com/questions/3400309/find-c-execution-time">find c++ execution time</a>, however since the program is not serial. One class calls another, and that calls another, I don't know how system clock/ticks would be implementable?</p>
  
  <p>I read of program like Valgrind, Zoom, Poor Man's Profiler etc. but honestly have no idea on integrating it with the code. Is there so simpler method?</p>
  
  <p>I also read this method: <a href="https://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux/378024#378024">How can I profile C++ code running in Linux?</a>, however I don't see how I could get pin-pointed information as to class based information (Class 1, Class 2 etc.)</p>
  
  <p>Could someone please advise for a newbie?</p>