Subject: Re: weird time(1) behaviour
To: None <current-users@NetBSD.org>
From: David Laight <david@l8s.co.uk>
List: current-users
Date: 09/30/2007 20:44:17
On Sun, Sep 30, 2007 at 09:15:01PM +0200, Thomas Klausner wrote:
> Hi!
> 
> I tried to time a long-running operation today on
> NetBSD-4.99.31/amd64. In the middle I statused it (CTRL-T),
> interrupted it (CTRL-Z) and then timed it again when I put it in the
> foreground again. The output was like this:
> 
> # time longcmd
> load: 2.86  cmd: longcmd 29364 [runnable] 2952.86u 126.60s 96% 104136k
> ^Z
> [1]+  Stopped                 longcmd
> 
> real    75m15.099s
> user    0m0.000s
> sys     0m0.001s
> # time fg
> longcmd
> 
> real    4m35.770s
> user    69m18.580s
> sys     2m51.754s
> 
> Why is the user/system time in the first time(1) output 0, and the
> second time(1) output has the correct date for the complete runtime
> (at least I guess it has)?

Almost certainly because the current execution period isn't added into
the processes execution time.
This has been reported before (IIRC on sparc) but I haven't managed
to reproduce it - and hence try to actually fix it.

	David

-- 
David Laight: david@l8s.co.uk