zsh-users
 help / color / mirror / code / Atom feed
* tcsh set time equivalent
@ 2011-09-30 21:58 Renato Botelho
  2011-09-30 22:12 ` Mikael Magnusson
  0 siblings, 1 reply; 7+ messages in thread
From: Renato Botelho @ 2011-09-30 21:58 UTC (permalink / raw)
  To: zsh-users

Hello,

I used to have a configuration on tcsh:

set time=(60 "\
Time spent in user mode   (CPU seconds) : %Us\
Time spent in kernel mode (CPU seconds) : %Ss\
Total time                              : %Es\
CPU utilisation (percentage)            : %P\
Times the process was swapped           : %W\
Times of major page faults              : %F\
Times of minor page faults              : %R")

With this, if a command that took over 60s to be executed, this
summary was showed after.

Is there any equivalent function on zsh?

Regards
-- 
Renato Botelho


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

* Re: tcsh set time equivalent
  2011-09-30 21:58 tcsh set time equivalent Renato Botelho
@ 2011-09-30 22:12 ` Mikael Magnusson
  2011-10-02  2:07   ` Dan Nelson
  2011-10-07 16:01   ` Renato Botelho
  0 siblings, 2 replies; 7+ messages in thread
From: Mikael Magnusson @ 2011-09-30 22:12 UTC (permalink / raw)
  To: Renato Botelho; +Cc: zsh-users

On 30 September 2011 23:58, Renato Botelho <rbgarga@gmail.com> wrote:
> Hello,
>
> I used to have a configuration on tcsh:
>
> set time=(60 "\
> Time spent in user mode   (CPU seconds) : %Us\
> Time spent in kernel mode (CPU seconds) : %Ss\
> Total time                              : %Es\
> CPU utilisation (percentage)            : %P\
> Times the process was swapped           : %W\
> Times of major page faults              : %F\
> Times of minor page faults              : %R")
>
> With this, if a command that took over 60s to be executed, this
> summary was showed after.
>
> Is there any equivalent function on zsh?

There's REPORTTIME (just assign a number to it), but it measures cpu
time, not wall clock.

-- 
Mikael Magnusson


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

* Re: tcsh set time equivalent
  2011-09-30 22:12 ` Mikael Magnusson
@ 2011-10-02  2:07   ` Dan Nelson
  2011-10-07 16:01   ` Renato Botelho
  1 sibling, 0 replies; 7+ messages in thread
From: Dan Nelson @ 2011-10-02  2:07 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: Renato Botelho, zsh-users

In the last episode (Oct 01), Mikael Magnusson said:
> On 30 September 2011 23:58, Renato Botelho <rbgarga@gmail.com> wrote:
> > I used to have a configuration on tcsh:
> >
> > set time=(60 "\
> > Time spent in user mode   (CPU seconds) : %Us\
> > Time spent in kernel mode (CPU seconds) : %Ss\
> > Total time                              : %Es\
> > CPU utilisation (percentage)            : %P\
> > Times the process was swapped           : %W\
> > Times of major page faults              : %F\
> > Times of minor page faults              : %R")
> >
> > With this, if a command that took over 60s to be executed, this summary
> > was showed after.
> >
> > Is there any equivalent function on zsh?
> 
> There's REPORTTIME (just assign a number to it), but it measures cpu time,
> not wall clock.

tcsh measures CPU time too.  Renato, you'll also want to set TIMEFMT to your
output format string; zsh understands all the escape sequences in your
string, so you can use it unmodified if you want, or add more.

-- 
	Dan Nelson
	dnelson@allantgroup.com


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

* Re: tcsh set time equivalent
  2011-09-30 22:12 ` Mikael Magnusson
  2011-10-02  2:07   ` Dan Nelson
@ 2011-10-07 16:01   ` Renato Botelho
  2011-10-07 16:14     ` Mikael Magnusson
  2011-10-07 16:51     ` Bart Schaefer
  1 sibling, 2 replies; 7+ messages in thread
From: Renato Botelho @ 2011-10-07 16:01 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh-users

On Fri, Sep 30, 2011 at 7:12 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
> On 30 September 2011 23:58, Renato Botelho <rbgarga@gmail.com> wrote:
>> Hello,
>>
>> I used to have a configuration on tcsh:
>>
>> set time=(60 "\
>> Time spent in user mode   (CPU seconds) : %Us\
>> Time spent in kernel mode (CPU seconds) : %Ss\
>> Total time                              : %Es\
>> CPU utilisation (percentage)            : %P\
>> Times the process was swapped           : %W\
>> Times of major page faults              : %F\
>> Times of minor page faults              : %R")
>>
>> With this, if a command that took over 60s to be executed, this
>> summary was showed after.
>>
>> Is there any equivalent function on zsh?
>
> There's REPORTTIME (just assign a number to it), but it measures cpu
> time, not wall clock.

Hello Mikael,

I set REPORTTIME=2, and ran a `find /usr -type l -name '*xxxx*'`, it took
about 20 seconds do execute and at the end, it didn't show anything.

I saw zshparams manpage and this parameter is there as you said. Is there
anything else i need to consider?

I'm using zsh 4.3.11 on fedora 15

Regards
-- 
Renato Botelho


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

* Re: tcsh set time equivalent
  2011-10-07 16:01   ` Renato Botelho
@ 2011-10-07 16:14     ` Mikael Magnusson
  2011-10-07 18:58       ` Renato Botelho
  2011-10-07 16:51     ` Bart Schaefer
  1 sibling, 1 reply; 7+ messages in thread
From: Mikael Magnusson @ 2011-10-07 16:14 UTC (permalink / raw)
  To: Renato Botelho; +Cc: zsh-users

On 7 October 2011 18:01, Renato Botelho <rbgarga@gmail.com> wrote:
> On Fri, Sep 30, 2011 at 7:12 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
>> On 30 September 2011 23:58, Renato Botelho <rbgarga@gmail.com> wrote:
>>> Hello,
>>>
>>> I used to have a configuration on tcsh:
>>>
>>> set time=(60 "\
>>> Time spent in user mode   (CPU seconds) : %Us\
>>> Time spent in kernel mode (CPU seconds) : %Ss\
>>> Total time                              : %Es\
>>> CPU utilisation (percentage)            : %P\
>>> Times the process was swapped           : %W\
>>> Times of major page faults              : %F\
>>> Times of minor page faults              : %R")
>>>
>>> With this, if a command that took over 60s to be executed, this
>>> summary was showed after.
>>>
>>> Is there any equivalent function on zsh?
>>
>> There's REPORTTIME (just assign a number to it), but it measures cpu
>> time, not wall clock.
>
> Hello Mikael,
>
> I set REPORTTIME=2, and ran a `find /usr -type l -name '*xxxx*'`, it took
> about 20 seconds do execute and at the end, it didn't show anything.
>
> I saw zshparams manpage and this parameter is there as you said. Is there
> anything else i need to consider?
>
> I'm using zsh 4.3.11 on fedora 15

Like I said, it uses cpu time, not wall clock time. I can't imagine
find uses 2 whole cpu seconds while looking for files, so it makes
sense that it wouldn't show up.

-- 
Mikael Magnusson


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

* Re: tcsh set time equivalent
  2011-10-07 16:01   ` Renato Botelho
  2011-10-07 16:14     ` Mikael Magnusson
@ 2011-10-07 16:51     ` Bart Schaefer
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2011-10-07 16:51 UTC (permalink / raw)
  To: zsh-users

On Oct 7,  1:01pm, Renato Botelho wrote:
}
} I set REPORTTIME=2, and ran a `find /usr -type l -name '*xxxx*'`, it took
} about 20 seconds do execute and at the end, it didn't show anything.

torch% REPORTTIME=2
torch% (repeat 1000000; do print -n; done)
( repeat 1000000; do; print -n; done; )  2.60s user 1.15s system 100% cpu 3.751
total
torch% TIMEFMT="\                                     
Time spent in user mode  (CPU seconds)  : %Us
Time spent in kernel mode (CPU seconds) : %Ss
Total time                              : %Es
CPU utilisation (percentage)            : %P
Times the process was swapped           : %W
Times of major page faults              : %F
Times of minor page faults              : %R"
torch% (repeat 1000000; do print -n; done)
Time spent in user mode  (CPU seconds)  : 2.54ss
Time spent in kernel mode (CPU seconds) : 1.21ss
Total time                              : 3.75ss
CPU utilisation (percentage)            : 99%
Times the process was swapped           : 0
Times of major page faults              : 0
Times of minor page faults              : 110
torch% 

-- 
Barton E. Schaefer


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

* Re: tcsh set time equivalent
  2011-10-07 16:14     ` Mikael Magnusson
@ 2011-10-07 18:58       ` Renato Botelho
  0 siblings, 0 replies; 7+ messages in thread
From: Renato Botelho @ 2011-10-07 18:58 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh-users

On Fri, Oct 7, 2011 at 1:14 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
> On 7 October 2011 18:01, Renato Botelho <rbgarga@gmail.com> wrote:
>> On Fri, Sep 30, 2011 at 7:12 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
>>> On 30 September 2011 23:58, Renato Botelho <rbgarga@gmail.com> wrote:
>>>> Hello,
>>>>
>>>> I used to have a configuration on tcsh:
>>>>
>>>> set time=(60 "\
>>>> Time spent in user mode   (CPU seconds) : %Us\
>>>> Time spent in kernel mode (CPU seconds) : %Ss\
>>>> Total time                              : %Es\
>>>> CPU utilisation (percentage)            : %P\
>>>> Times the process was swapped           : %W\
>>>> Times of major page faults              : %F\
>>>> Times of minor page faults              : %R")
>>>>
>>>> With this, if a command that took over 60s to be executed, this
>>>> summary was showed after.
>>>>
>>>> Is there any equivalent function on zsh?
>>>
>>> There's REPORTTIME (just assign a number to it), but it measures cpu
>>> time, not wall clock.
>>
>> Hello Mikael,
>>
>> I set REPORTTIME=2, and ran a `find /usr -type l -name '*xxxx*'`, it took
>> about 20 seconds do execute and at the end, it didn't show anything.
>>
>> I saw zshparams manpage and this parameter is there as you said. Is there
>> anything else i need to consider?
>>
>> I'm using zsh 4.3.11 on fedora 15
>
> Like I said, it uses cpu time, not wall clock time. I can't imagine
> find uses 2 whole cpu seconds while looking for files, so it makes
> sense that it wouldn't show up.

You are right, my bad. It's working fine.

Thank you
-- 
Renato Botelho


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

end of thread, other threads:[~2011-10-07 18:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-30 21:58 tcsh set time equivalent Renato Botelho
2011-09-30 22:12 ` Mikael Magnusson
2011-10-02  2:07   ` Dan Nelson
2011-10-07 16:01   ` Renato Botelho
2011-10-07 16:14     ` Mikael Magnusson
2011-10-07 18:58       ` Renato Botelho
2011-10-07 16:51     ` Bart Schaefer

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