Mail Archives: djgpp/2002/03/11/10:45:06
Brozewicz Robert F <brozewicz DOT rf AT mellon DOT com> wrote in
news:20020311142313 DOT 11973 DOT qmail AT mellon DOT com:
> im not sure if this made it to the list seeing i received a few
> responses that i had my e-mail in html format instead of text format.
> so im posing it again.
I don't understand this. Three people responded to your post, and you
responded to Eli's, so you must know your post made it here.
> can someone please share with me a 'c' routine that can be used to
> display how long a program executes in hours/minutes/second and down
> to the lowest time possible.
>
> i want to be able to time how long a program runs.
depends on what your purpose is. if you are trying to collect data for
optimization, then you should look into 'profiling' (using gprof).
if all you want is a simple uptime function, then you can use time, clock,
uclock and assorted friends. note that the more resolution you want, the
more you are going to run in to problems with counters wrapping, especially
if your program is supposed to run for more than a day.
on the other hand, one of the simplest solutions is to invoke your program
with redir -t myprog.exe
it is hard to recommend a specific method without knowing why you need
this.
Sinan.
- Raw text -