I heared that gprof can provide such info, am I wrong ? that's why I am asking this question in a gcc mailing list. One of code optimization goal is to reduce execution time, and gcc users had to measure the execution time of a program to evaluate optimizations. they should be familiar with tools that measures the execution time... Thanks ----- Message d'origine ---- De : Ian Lance Taylor <iant@xxxxxxxxxx> À : charfi asma <charfiasma@xxxxxxxx> Cc : gcc-help@xxxxxxxxxxx Envoyé le : Mer 21 avril 2010, 16 h 58 min 55 s Objet : Re: execution time of a c++ program charfi asma <charfiasma@xxxxxxxx> writes: > how can we measure the time spent to execute a C++ program (not to compile it) ? > > should we add code to calculate manually this time (using Time.h or other predefined classes in predefined library like boost ? This is not really a gcc question at all. You may want to consider asking on a C++ language forum. If you want to measure the time for a complete execution, you can just the Unix time command. Otherwise, I think you have to modify the program. I don't know whether Boost has any helpful classes here. Ian