time(1) General Commands Manual time(1)Name
time - time a command
The command lets the specified command execute and then outputs the amount of elapsed real time, the time spent in the operating system,
and the time spent in execution of the command. Times are reported in seconds and are written to standard error.
If you are using any shell except the C shell, you can give the command as shown on the first line of the Syntax section. If you are using
the C shell, you must use the command's full pathname as shown on the second line of the Syntax section. If you do not use the full path-
name, will execute its own built-in command that supplies additional information and uses a different output format.
The command can be used to cause a command to be timed no matter how much CPU time it takes. For example:
% /bin/time cp /etc/rc /usr/bill/rc
0.1 real 0.0 user 0.0 sys
% /bin/time nroff sample1 > sample1.nroff
3.6 real 2.4 user 1.2 sys
This example indicates that the command used negligible amounts of user and system time and had an elapsed time of 1/10 second (0.1). The
command used 2.4 seconds of user time and 1.2 seconds of system time, and required 3.6 seconds of elapsed time.
Times are measured to an accuracy of 1/10 second. Thus, the sum of the user and system times can be larger than the elapsed time.
Check Out this Related Man Page
rusage(1B) SunOS/BSD Compatibility Package Commands rusage(1B)NAME
rusage - print resource usage for a command
The rusage command is similar to time(1). It runs the given command, which must be specified; that is, command is not optional as it is in
the C shell's timing facility. When the command is complete, rusage displays the real (wall clock), the system CPU, and the user CPU times
which elapsed during execution of the command, plus other fields in the rusage structure, all on one long line. Times are reported in sec-
onds and hundredths of a second.
Example 1 The format of rusage output
The example below shows the format of rusage output.
example% rusage wc /usr/share/man/man1/csh(1)
3045 13423 78071 /usr/share/man/man1/csh(1)
2.26 real 0.80 user 0.36 sys 11 pf 38 pr 0 sw 11 rb 0 wb 16 vcx 37
icx 24 mx 0 ix 1230 id 9 is
Each of the fields identified corresponds to an element of the rusage structure, as described in getrusage(3C), as follows:
real elapsed real time
user ru_utime user time used
sys ru_stime system time used
pf ru_majflt page faults requiring physical I/O
pr ru_minflt page faults not requiring physical I/O
sw ru_nswap swaps
rb ru_inblock block input operations
wb ru_oublock block output operations
vcx ru_nvcsw voluntary context switches
icx ru_nivcsw involuntary context switches
mx ru_maxrss maximum resident set size
ix ru_ixrss currently 0
id ru_idrss integral resident set size
is ru_isrss currently 0
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWscpu |
SEE ALSO csh(1), time(1), getrusage(3C), attributes(5)BUGS
When the command being timed is interrupted, the timing values displayed may be inaccurate.
SunOS 5.11 14 Sep 1992 rusage(1B)
This goes deeper into the date thing. I want to be able to check the date and time stamp in or on a file to see what the time span is.
We have a job that runs several times an hour - kicked off through cron based on a trigger file. We want to keep track of each run and check the time between... (14 Replies)
When my script is run, it will ask the user to enter some text and the user should be restricted not to enter more than 50 chars. Is there any command which I can use with "read" command? Help me please (18 Replies)
I have a script like this:
while read abbrev; do
sed 's/'$(echo "$abbrev" | tr "" "")'/'"$abbrev"'/g' 'output_rgt.'$$ >'tmp.'$$
mv 'tmp.'$$ 'output_rgt.'$$
And I don't know how to leave "mv" out. ('dict.shortcuts.'$$ may be... (14 Replies)
I thought that access time of a file is time when the file was run last time (or I read somewhere that it's time when system lookup the file -> but I'm not sure when it really is)
How is it exactly?
Thank you for help! (11 Replies)
I am currently having a problem with displaying multiple occurences of a line using grep/sed combination. Let's say that I do grep "$anything" $file.
When I do this it only displays a single line, but if I do grep -c "$anything" $file it says that there are 3 occurences of $anything, but how can... (15 Replies)
I am working on a script which requires an input from user within one 1 min.
So if the user gives the required input within 1 min., it will execute on the basis of input provided by the user.Other wise it will execute on a default value(hard coded inside the script).
Now, I am... (19 Replies)
I am trying to write a script that will accomplish the following:
- query current system time and store result into a variable
- wait for some amount of time, say 300 seconds
- reset system time to earlier queried time + 1 second
I did some basic shell scripting (CSH... (11 Replies)
I have spent my full day looking for the solution..:wall:but could no resolved.
Here it goes:
I have a txt file say data.txt. The content is shown below:
I have shown the blank line knowingly. If I open this txt file using... (12 Replies)
I have a file
The file should have 4 fields to load into a database. The file may have cr, lf, or end of line characters.
What I want to see as output is
I have tried (17 Replies)
I have been trying to do a small fun project for myself.
I want to run a command for 45 seconds.
And to get the final output of this command, the script requires I push the "q" key on my keyboard and then the final output file becomes available.
I tried the following script. But it... (12 Replies)
I have been using ksh till now but was forced to use tcsh from last few days. I am getting a gvimrc error which says "set: Syntax error". What makes this pesky is that it is not showing which line number is the error from. How do I get the line number of the error?
Also, I am using the... (11 Replies)
Hi ,I got one data file from external source and I have to load it in database through sql loader. I want to add 2 columns in database,one is file name and one is time of the file received on server.
-rwxr-x--- 1 user user 238 Jun 03 16:32 90936264971326030616.ctr
From above case,... (21 Replies)