public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Time of compiling
@ 2006-11-11 20:14 shart
  2006-11-11 20:54 ` Perry Smith
  0 siblings, 1 reply; 8+ messages in thread
From: shart @ 2006-11-11 20:14 UTC (permalink / raw)
  To: gcc-help


Is possible to show the time of compilig?In Gcc and also in Gpp?
thanks
-- 
View this message in context: http://www.nabble.com/Time-of-compiling-tf2614187.html#a7296286
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Time of compiling
  2006-11-11 20:14 Time of compiling shart
@ 2006-11-11 20:54 ` Perry Smith
  2006-11-12  9:34   ` shart
  0 siblings, 1 reply; 8+ messages in thread
From: Perry Smith @ 2006-11-11 20:54 UTC (permalink / raw)
  To: shart; +Cc: gcc-help

On Nov 11, 2006, at 2:14 PM, shart wrote:

>
> Is possible to show the time of compilig?In Gcc and also in Gpp?
> thanks
> --  
> View this message in context: http://www.nabble.com/Time-of- 
> compiling-tf2614187.html#a7296286
> Sent from the gcc - Help mailing list archive at Nabble.com.

I think it is __TIME__ (there is __DATE__ as well).


Perry Smith
Ease Software, Inc.
pedz@easesoftware.com
http://www.easesoftware.com

Low cost SATA Products for IBMs p5, pSeries, and RS/6000 AIX systems



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Time of compiling
  2006-11-11 20:54 ` Perry Smith
@ 2006-11-12  9:34   ` shart
  2006-11-12 10:52     ` Raúl Huertas
  0 siblings, 1 reply; 8+ messages in thread
From: shart @ 2006-11-12  9:34 UTC (permalink / raw)
  To: gcc-help


Thanks for you answer.
Can you show me an example with this syntaxt. thanks


Perry Smith-2 wrote:
> 
> On Nov 11, 2006, at 2:14 PM, shart wrote:
> 
>>
>> Is possible to show the time of compilig?In Gcc and also in Gpp?
>> thanks
>> --  
>> View this message in context: http://www.nabble.com/Time-of- 
>> compiling-tf2614187.html#a7296286
>> Sent from the gcc - Help mailing list archive at Nabble.com.
> 
> I think it is __TIME__ (there is __DATE__ as well).
> 
> 
> Perry Smith
> Ease Software, Inc.
> pedz@easesoftware.com
> http://www.easesoftware.com
> 
> Low cost SATA Products for IBMs p5, pSeries, and RS/6000 AIX systems
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Time-of-compiling-tf2614187.html#a7301019
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Time of compiling
  2006-11-12  9:34   ` shart
@ 2006-11-12 10:52     ` Raúl Huertas
  2006-11-12 10:57       ` shart
  0 siblings, 1 reply; 8+ messages in thread
From: Raúl Huertas @ 2006-11-12 10:52 UTC (permalink / raw)
  To: shart; +Cc: gcc-help

shart escribió:
> Thanks for you answer.
> Can you show me an example with this syntaxt. thanks
>
>   
In C++:

#include <iostream>
int main()
{
    std::cout << __TIME__ << '-' << __DATE__ << std::endl;
}


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Time of compiling
  2006-11-12 10:52     ` Raúl Huertas
@ 2006-11-12 10:57       ` shart
  2006-11-12 11:08         ` Raúl Huertas
  2006-11-12 13:39         ` Time of compiling (Gross hideous mess) Perry Smith
  0 siblings, 2 replies; 8+ messages in thread
From: shart @ 2006-11-12 10:57 UTC (permalink / raw)
  To: gcc-help


thanks for your raply

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

raulh39@ya.com wrote:
> 
> shart escribió:
>> Thanks for you answer.
>> Can you show me an example with this syntaxt. thanks
>>
>>   
> In C++:
> 
> #include <iostream>
> int main()
> {
>     std::cout << __TIME__ << '-' << __DATE__ << std::endl;
> }
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Time-of-compiling-tf2614187.html#a7301514
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Time of compiling
  2006-11-12 10:57       ` shart
@ 2006-11-12 11:08         ` Raúl Huertas
  2006-11-12 13:39         ` Time of compiling (Gross hideous mess) Perry Smith
  1 sibling, 0 replies; 8+ messages in thread
From: Raúl Huertas @ 2006-11-12 11:08 UTC (permalink / raw)
  To: shart; +Cc: gcc-help

shart escribió:
> thanks for your raply
>
> I want that the compiler show the entire duration (in second) of compilation
> of any programm.
>
>   
¿Do you mean the duration of the compilation of one translation unit (a 
.c or .cc file, for example)?
A program normally  have a lot of translation units, and each one of 
them requires an invocation to the gcc compiler.

I don't know of any way to sum up this times. If you are in Unix, maybe 
you can use the "time" command when you launch "make", but I'm not sure 
that that's what you mean...

Regards,
Raúl.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Time of compiling (Gross hideous mess)
  2006-11-12 10:57       ` shart
  2006-11-12 11:08         ` Raúl Huertas
@ 2006-11-12 13:39         ` Perry Smith
  1 sibling, 0 replies; 8+ messages in thread
From: Perry Smith @ 2006-11-12 13:39 UTC (permalink / raw)
  To: shart; +Cc: gcc-help

On Nov 12, 2006, at 4:57 AM, shart wrote:

>
> thanks for your raply
>
> I want that the compiler show the entire duration (in second) of  
> compilation
> of any programm.
>
> raulh39@ya.com wrote:
>>
>> shart escribió:
>>> Thanks for you answer.
>>> Can you show me an example with this syntaxt. thanks
>>>
>>>
>> In C++:
>>
>> #include <iostream>
>> int main()
>> {
>>     std::cout << __TIME__ << '-' << __DATE__ << std::endl;
>> }

Are you wanting to do this inside the program?  If not, then Raúl's  
suggestion is what you want.  "time gcc -c x.c" will spit out the  
time that the gcc took.  If you have lots of modules, put them in a  
make file and just to "time make"

I thought you wanted to do it from inside the program.  Like when it  
first starts up, it would tell you how much time it took to compile.

__TIME__ returns a string (or it IS a string actually).  You could  
put one at the top of each file.  Plus have an extra file that is  
compiled at the end of the list of files that has another.  e.g.  In  
each file do:

this_file_cpp_time = __DATE__ " " __TIME__;

(where "this_file" would be different for each file).

Put all of these in a table maybe.  Then have a routine go through  
the table of strings and convert them to time structures -- see  
strptime et. al. for info.

 From the time structures you can do your computations.

Hope this helps...
Perry Smith
Ease Software, Inc.
pedz@easesoftware.com
http://www.easesoftware.com

Low cost SATA Products for IBMs p5, pSeries, and RS/6000 AIX systems



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Time of compiling
@ 2006-11-17 10:10 Jayant Sonar
  0 siblings, 0 replies; 8+ messages in thread
From: Jayant Sonar @ 2006-11-17 10:10 UTC (permalink / raw)
  To: shart1; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-11-17 10:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-11 20:14 Time of compiling shart
2006-11-11 20:54 ` Perry Smith
2006-11-12  9:34   ` shart
2006-11-12 10:52     ` Raúl Huertas
2006-11-12 10:57       ` shart
2006-11-12 11:08         ` Raúl Huertas
2006-11-12 13:39         ` Time of compiling (Gross hideous mess) Perry Smith
2006-11-17 10:10 Time of compiling Jayant Sonar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).