This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] MI: new timing command
> The autoconf manual has information about this sort of thing. I see
> that libiberty guards it, sometimes with HAVE_GETRUSAGE and other times
> with that and HAVE_SYS_RESOURCE_H.
>
> Will libiberty's get_run_time suffice for whatever you were doing,
> Nick?
The manual says:
-- Replacement: long get_run_time (void)
Returns the time used so far, in microseconds. If possible, this
is the time used by this process, else it is the elapsed time
since the process started.
Without looking at the code, I would guess it's just a wrapper for getrusage
and it uses something like gettimeofday for elapsed time when it can't find
it. I think if user time isn't available it's best just to make
-enable-timings fail, so I'll use Eli's suggestion.
--
Nick http://www.inet.net.nz/~nickrob