Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

time builtin



I just observed this broken behaviour in 3.0.0 and 3.1.0.
The real time reported by builtin time (%E) is almost
always less than %U + %S. A quick test shows that this
behaviour is not present in 2.6-beta13.

Now printtime() in 2.6-beta13 had this code:

    if (percent > 100)
        percent = 100;   /* just to make it look right */

but that was removed in 3.0.0. Reinserting those two lines
in 3.0.0 obviously ``fixes'' the problem, or perhaps it is
more accurate to say that it hides the real problem again.

Is it possible to fix this, or are the times here just to
close to the resolution provided by the kernel?

$ echo $ZSH_VERSION
3.0.0
$ echo $OSTYPE
sunos4.1.4
$ echo $TIMEFMT
%*E real  %*U user  %*S system  %P (%J)
$ 
$ time ls
adapter.gif     hpdat
0.048 real  0.017 user  0.033 system  103% (ls)
adapter.gif     hpdat
$ time ls
adapter.gif     hpdat
0.001 real  0.000 user  0.017 system  2810% (ls)
$ time ls
adapter.gif     hpdat
0.048 real  0.017 user  0.033 system  103% (ls)
$ time ls
adapter.gif     hpdat
0.001 real  0.017 user  0.000 system  2692% (ls)
$ time ls
adapter.gif     hpdat
0.021 real  0.033 user  0.017 system  236% (ls)
$ time ls
adapter.gif     hpdat
0.001 real  0.000 user  0.033 system  5555% (ls)
$ time ls
adapter.gif     hpdat
0.035 real  0.000 user  0.033 system  93% (ls)
$ time ls
adapter.gif     hpdat
0.001 real  0.000 user  0.017 system  2741% (ls)
$ 

-- 
 Goran Larsson                mailto:hoh @ approve . se
 I was an atheist,            http://home1.swipnet . se/%7Ew-12153/
 until I found out I was God.



Messages sorted by: Reverse Date, Date, Thread, Author