zsh-workers
 help / color / mirror / code / Atom feed
* Maybe a bug?
@ 2002-01-02 22:17 Raúl Núñez de Arenas Coronado
  2002-01-02 22:36 ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Raúl Núñez de Arenas Coronado @ 2002-01-02 22:17 UTC (permalink / raw)
  To: Zsh

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

    Hi zshworkers :))

    It's me again ;)) Excuse the continous questions, but I've
recently installed zsh for general use at work and I'm configuring
it ;))

    Well, the matter now is that the builtin 'time' command report
wrong numbers when the measured time is slow. First of all, it tends
too much to give '0.000' as the elapsed time, even if the user or
kernel times are not 0. The elapsed time should be, at least, the sum
of user and kernel time, shouldn't it?.

    The other issue is a possible bug with the percentage escape
sequence. When the elapsed time is 0, it obviously reports a wrong
CPU percentage usage... It should return 0, not 18887% as it uses.

    That's all folks :))

    Raúl


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Maybe a bug?
  2002-01-02 22:17 Maybe a bug? Raúl Núñez de Arenas Coronado
@ 2002-01-02 22:36 ` Zefram
  0 siblings, 0 replies; 3+ messages in thread
From: Zefram @ 2002-01-02 22:36 UTC (permalink / raw)
  To: =?unknown-8bit?Q?Ra=FAl_N=FA=F1ez?= de Arenas Coronado; +Cc: Zsh

Ra?l N??ez de Arenas Coronado wrote:
>    Well, the matter now is that the builtin 'time' command report
>wrong numbers when the measured time is slow. First of all, it tends
>too much to give '0.000' as the elapsed time, even if the user or
>kernel times are not 0. The elapsed time should be, at least, the sum
>of user and kernel time, shouldn't it?.

Strictly speaking no; on a multi-processor system one can use more CPU
time than elapsed wall time, by using CPU time on more than one processor
simultaneously.  What you're more likely seeing, though, is differences
in the way CPU time and wall time are counted.  That's up to the kernel,
and there's nothing zsh can do to fix it.

>    The other issue is a possible bug with the percentage escape
>sequence. When the elapsed time is 0, it obviously reports a wrong
>CPU percentage usage... It should return 0, not 18887% as it uses.

Obviously the elapsed time is not zero in this case, it's just too
small to show as non-zero in the output format we use.  We used to cap
displayed CPU usage to 100% in these cases (where elapsed time is less
than CPU time), but removed that because of the multi-processor issue
-- it can be correct to show more than 100% CPU usage (if the program
averaged using more than one CPU at a time).

-zefram


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Maybe a bug?
@ 2002-01-02 23:08 Raúl Núñez de Arenas Coronado
  0 siblings, 0 replies; 3+ messages in thread
From: Raúl Núñez de Arenas Coronado @ 2002-01-02 23:08 UTC (permalink / raw)
  To: raul, zefram; +Cc: zsh-workers

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]

    Hi again, Zefram :)

>>kernel times are not 0. The elapsed time should be, at least, the sum
>>of user and kernel time, shouldn't it?.
>Strictly speaking no; on a multi-processor system

    Yes, I forgot O:))) I'm not very accostumed to SMP boxes ;)

>>It should return 0, not 18887% as it uses.
>Obviously the elapsed time is not zero in this case, it's just too
>small to show as non-zero in the output format we use.

    Yes, it's true. But the percentage is bad anyway :??

>-- it can be correct to show more than 100% CPU usage (if the program
>averaged using more than one CPU at a time).

    Yes again... Well, anyway I use 'GNU time' most of the time when
doing statistics for my programs, and then the number matters. I'll
use the builtin time for general use (sometimes I want to profile
shell functions, and the builtin time is better for that).

    Thanks a lot for your help. I'm really falling in love with zsh
every second I use it :))) Far better than Bash, IMHO. Without the
ugly readline, the amazing completion system, etc... I'm afraid I
won't be able to learn all its capabilities in this life ;))

    Raúl


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-01-02 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-02 22:17 Maybe a bug? Raúl Núñez de Arenas Coronado
2002-01-02 22:36 ` Zefram
2002-01-02 23:08 Raúl Núñez de Arenas Coronado

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).