bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFE: automatic "time" output for long-running commands


From: John Saalwaechter
Subject: RFE: automatic "time" output for long-running commands
Date: Wed, 8 Sep 2010 11:41:41 -0700

When I've used tcsh in the past, a very useful feature was its "time"
variable.  From the man page:

"""
time
Controls automatic timing of commands.  If set, then any command that
takes more than this many CPU seconds will cause a line giving user,
system, and real times, and a utilization percentage which is the
ratio of user plus system times to real time to be printed when it
terminates.
"""

This is a great convenience, because you don't need to anticipate
ahead of time which commands you want to run using the time builtin.
Any long running command automatically results in getting "time"
output, regardless of whether you anticipated the long run time or
not.  In fact, it's often the commands that unexpectedly ran long that
you want time output for.

Example showing this behavior in in tcsh:

% set time=5
% echo this is a short cmd
this is a short cmd
% ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 Sep  7 12:04 /dev/null
% perl -e 'alarm(10); while(1){$a++}'
Alarm clock
9.9u 0.0s 0:10.00 99.4% 0+0k 0+0io 0pf+0w
%

John
--
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]