Time taken to compress a file [message #154788] |
Tue, 10 January 2006 10:48  |
toshidas2000
Messages: 120 Registered: November 2005
|
Senior Member |
|
|
All
How do I know, how much time it took to compress a file.
If I do
$ date
$ compress file_name
I have to keep an eye on monitor to see when it finishes and do date again.
Like oracle has set timing on and gives exact time taken to complete a command, do we have any similar on Unix (solaris).
Please help
Thanks
|
|
|
|
Re: Time taken to compress a file [message #154844 is a reply to message #154822] |
Tue, 10 January 2006 23:25   |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
You can do something like this,
create a shell script
$cat > elapsed_time.sh
start_time=`date '+%d/%m/%y %H:%M:%S'`
compress file_name # your command
end_time=`date '+%d/%m/%y %H:%M:%S'`
echo $start_time
echo $end_time
so when you run the script you will get the start time as well as the end time.
|
|
|
Re: Time taken to compress a file [message #154865 is a reply to message #154788] |
Wed, 11 January 2006 01:23   |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Just prefix the command with 'time'
Or, you really want to do the subtraction yourself, issue 3 commands in one line:
date; compress filename; date
_____________
Ross Leishman
|
|
|
|
|
|
Re: Time taken to compress a file [message #155969 is a reply to message #155954] |
Fri, 20 January 2006 00:48  |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
The output of time command appears immediately before control is passed back to the shell. So NO, it doesn't estimate.
: c985675 ~/sql; time sleep 6
real 0m6.096s
user 0m0.000s
sys 0m0.080s
The one you want is the 'real' time. It measures elapsed time.
I believe 'sys' is like 'cpu' time. Not sure what 'user' is.
_____________
Ross Leishman
|
|
|