delorie.com is funded by banner ads.
  www.delorie.com/djgpp/v2faq/faq105.html   search  

| Previous | Next | Up | Top |

13.1 How to profile a DJGPP program

Q: How can I profile my program to see where it spends most of its run time?


A: DJGPP includes a profiling facility. To use it, compile and link with -pg option, run your program as you usually would, then run a program called gprof:
      gprof myprog

(change myprog to whatever name your program is). This will print an execution profile. You can now look at the profile and try to optimize the functions which take a large proportion of the execution time.

Gprof is further documented in the Binutils docs as part of the GNU Binutils distribution.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright ⌐ 1998   by Eli Zaretskii     Updated Sep 1998  

Powered by Apache!

You can help support this site by visiting the advertisers that sponsor it! (only once each, though)