Re: [PATCH] MI: new timing command

Mark Kettenis
2006-12-31T16:09:36Z

> X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on
> zigzag.lvk.cs.msu.su
> X-Spam-Level:
> X-Spam-Status: No, score=-4.4 required=5.5 tests=ALL_TRUSTED,BAYES_00
> autolearn=ham version=3.1.7
> From: Vladimir Prus <ghost@cs.msu.su>
> Date: Sun, 31 Dec 2006 18:37:58 +0300
> X-XS4ALL-DNSBL-Checked: mxdrop37.xs4all.nl checked 158.250.17.23 against DNS blacklists
> X-Virus-Scanned: by XS4ALL Virus Scanner
> X-XS4ALL-Spam-Score: 0.0 () DK_POLICY_SIGNSOME,UNPARSEABLE_RELAY
> X-XS4ALL-Spam: NO
> Envelope-To: mark.kettenis@xs4all.nl
> X-UIDL: 1167579527._smtp.mxdrop37.60237,S=2952
>
> Mark Kettenis wrote:
>
> >> Date: Sun, 31 Dec 2006 10:15:27 -0500
> >> From: Daniel Jacobowitz <drow@false.org>
> >>
> >> On Sun, Dec 31, 2006 at 08:42:12PM +1300, Nick Roberts wrote:
> >> > Daniel Jacobowitz writes:
> >> > > In that case you can copy the necessary guards from that file.
> >> > > However, it does more than just getrusage - it also supports
> >> > > platforms with times() but without getrusage, which IIRC includes
> >> > > Windows, so it might be better to use it.
> >> >
> >> > But as a last resort it returns elapsed time which would be wrong.
> >>
> >> You keep saying this but I don't see why. Why is it wrong? On every
> >> platform where we can do it, we'll print usage; on platforms where we
> >> can't do it, the odds are pretty good that the OS isn't aggressively
> >> scheduling other tasks in while we're running, so wall time is pretty
> >> close to right.
> >
> > I agree completely.
>
> Is this important? This timing is entirely for diagnostic purposes,
> so why try to make it work on every possible platform. We need to document
> that -enable-timing may fail, and that's it.

The point is to use get_run_time() from -liberty and never worry about
portability again.