zsh-workers
 help / color / mirror / code / Atom feed
* $REPORTTIME behaves weirdly on macOS
@ 2021-06-30 18:50 Marlon Richert
  2021-06-30 23:13 ` Mikael Magnusson
  0 siblings, 1 reply; 3+ messages in thread
From: Marlon Richert @ 2021-06-30 18:50 UTC (permalink / raw)
  To: Zsh hackers list

% REPORTTIME=0
% sleep 1
sleep 1  0.00s user 0.00s system 0% cpu 1.008 total
% REPORTTIME=1
% sleep 1
% REPORTTIME=0.99
% sleep 1
sleep 1  0.00s user 0.00s system 0% cpu 1.008 total
% REPORTTIME=1.001
% sleep 1
% sleep 2
% REPORTTIME=1.1
% sleep 2
% REPORTTIME=0.99
% sleep 2
sleep 2  0.00s user 0.00s system 0% cpu 2.006 total
%

What's going on here? It seems that when $REPORTTIME >= 1, no time
output is ever produced.

The exact values here are unique to sleep, but similar behavior can be
observed for other commands, too, albeit at different thresholds.


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

* Re: $REPORTTIME behaves weirdly on macOS
  2021-06-30 18:50 $REPORTTIME behaves weirdly on macOS Marlon Richert
@ 2021-06-30 23:13 ` Mikael Magnusson
  2021-07-01 20:05   ` Marlon Richert
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2021-06-30 23:13 UTC (permalink / raw)
  To: Marlon Richert; +Cc: Zsh hackers list

On 6/30/21, Marlon Richert <marlon.richert@gmail.com> wrote:
> % REPORTTIME=0
> % sleep 1
> sleep 1  0.00s user 0.00s system 0% cpu 1.008 total
> % REPORTTIME=1
> % sleep 1
> % REPORTTIME=0.99
> % sleep 1
> sleep 1  0.00s user 0.00s system 0% cpu 1.008 total
> % REPORTTIME=1.001
> % sleep 1
> % sleep 2
> % REPORTTIME=1.1
> % sleep 2
> % REPORTTIME=0.99
> % sleep 2
> sleep 2  0.00s user 0.00s system 0% cpu 2.006 total
> %
>
> What's going on here? It seems that when $REPORTTIME >= 1, no time
> output is ever produced.
>
> The exact values here are unique to sleep, but similar behavior can be
> observed for other commands, too, albeit at different thresholds.

REPORTTIME
 If  nonnegative,  commands  whose  combined  user and system execution
 times (measured in seconds) are greater than this  value  have  timing
 statistics  printed  for them.

Note the difference between elapsed time (total) and cpu time (user +
system) in your output.

-- 
Mikael Magnusson


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

* Re: $REPORTTIME behaves weirdly on macOS
  2021-06-30 23:13 ` Mikael Magnusson
@ 2021-07-01 20:05   ` Marlon Richert
  0 siblings, 0 replies; 3+ messages in thread
From: Marlon Richert @ 2021-07-01 20:05 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Zsh hackers list

On Thu, Jul 1, 2021 at 2:13 AM Mikael Magnusson <mikachu@gmail.com> wrote:
> > What's going on here? It seems that when $REPORTTIME >= 1, no time
> > output is ever produced.
> >
> > The exact values here are unique to sleep, but similar behavior can be
> > observed for other commands, too, albeit at different thresholds.
>
> REPORTTIME
>  If  nonnegative,  commands  whose  combined  user and system execution
>  times (measured in seconds) are greater than this  value  have  timing
>  statistics  printed  for them.
>
> Note the difference between elapsed time (total) and cpu time (user +
> system) in your output.

Ah, thanks. And I guess REPORTTIME is rounded down to an integer
value. That would explain it.


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

end of thread, other threads:[~2021-07-01 20:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 18:50 $REPORTTIME behaves weirdly on macOS Marlon Richert
2021-06-30 23:13 ` Mikael Magnusson
2021-07-01 20:05   ` Marlon Richert

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).