This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Time of compiling


Hi shart,

> I want that the compiler show the entire duration (in second) of
compilation
> of any programm.

If you are looking for the total time that compiler takes to compile 
a program, you can pass the command line option "-ftime-report" to 
compiler. It makes the compiler print some statistics about the time 
consumed by each pass when it finishes. 

e.g. when I passed this option while compiling my C program - "test.c"
as 
following -
	gcc test.c -ftime-report

I got the details about compilation time as - 

preprocessing :  0.01 (50%) usr   0.00 ( 0%) sys   0.00 ( 0%) wall
93 kB (12%) ggc
lexical analysis:  0.00 ( 0%) usr   0.00 ( 0%) sys   0.02 (67%) wall
0 kB ( 0%) ggc
TOTAL            :  0.02             0.00             0.03
768 kB

Regards
Jayant


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]