From: Perry Smith <pedz@easesoftware.com>
To: shart <shart1@jumpy.it>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Time of compiling (Gross hideous mess)
Date: Sun, 12 Nov 2006 13:39:00 -0000 [thread overview]
Message-ID: <C0297F93-D947-4C6A-A836-2A4DCF2075BE@easesoftware.com> (raw)
In-Reply-To: <7301514.post@talk.nabble.com>
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
prev parent reply other threads:[~2006-11-12 13:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Perry Smith [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C0297F93-D947-4C6A-A836-2A4DCF2075BE@easesoftware.com \
--to=pedz@easesoftware.com \
--cc=gcc-help@gcc.gnu.org \
--cc=shart1@jumpy.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).