stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] wall clock timing
Date Thu, 05 Oct 2006 18:54:34 GMT
Andrew Black wrote:
> Greetings all.
> 
> Attached is a small patch that adds wall clock timing to the exec 
> utility, and also fixes a documentation mistake that somehow missed 
> being included in r452253.

I committed this here:
http://svn.apache.org/viewvc?view=rev&rev=453314

but I'm not sure gettimeofday() is the best function for this.
Wouldn't times() be better?
http://www.opengroup.org/onlinepubs/009695399/functions/times.html

Btw., this also raises the question whether we could use times()
instead of getrusage() as well? It would be more efficient than
making two calls, one to getrusage() and another to gettimeofday(),
and it might also be more efficient since getrusage() typically
gathers/reports other data besides process times.

One last thing. While reading the POSIX spec I noticed that the
time_t and clock_t types may be integer or floating point while
our code seems to be making the assumption that they are the
former. We should fix that.

Thanks
Martin

Mime
View raw message