![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ksh script using expr to calculate percentages | wurzul | Shell Programming and Scripting | 6 | 05-01-2008 03:19 AM |
| calculate time | itik | AIX | 2 | 02-14-2008 10:08 PM |
| how to calculate CPU time under HP-UX | limame | HP-UX | 1 | 06-18-2007 02:28 PM |
| calculate the time differnce between two given timings | Olti | UNIX for Dummies Questions & Answers | 1 | 01-05-2006 09:22 AM |
| Calculate Elapsed Time | sysera | Shell Programming and Scripting | 5 | 06-16-2004 10:10 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
I want to know how to calculate time difference in unix shell script. Time command in unix will not solve my problem because it calculates total time taken by a script. See the examle below. example :- #!/bin/ksh # This is just example # Start the timer Shell commands .. Shell commands . # End of timer # I want to know how much time taken between start the timer and end of timer. Is there unix built in commands to do it easily. Unix Guru's please suggest. Thanks Sanjay |
| Forum Sponsor | ||
|
|
|
|||
|
Hello sskb,
Thanks for your response. I have to write the time or timex command for every shell command. What I want to do is take the difference of time between some line of commands in shell script. See the example below. example :- #!/bin/ksh # This is just example # Start the timer Shell commands .. Shell commands . # End of timer Did you get what I am trying to say. Sanjay |
|
|||
|
Yes sanjay! i got ur point. but as far as i know there is no such built in command. but if you don't mind .. i would tell u what i would do in that case.
just get the date and time store it! execute the stream of commands then again get the date and time. get the difference from that. I hope u have better idea than this. if so, please let me know. |
|
|||
|
Hello sskb,
Is there any straight forward method in Unix to subtract two time/date values. I know I can store date/time and in some temp variables but I have to write a programme to subtract these two values. I was looking for some Unix build in method for this. I know in unix there is something called difftime but I do not know how to use it in shell scripts. Sanjay |
|
|||
|
Can you tell me where the timex command is located. It is not in my path list. I can see man timex. I can see time command but unable to find out timex command in my system.
One question about time command. # This command does not work in ksh but works in sh or bash. $time -p echo sanjay Why -p option of time command does not work in ksh. Thanks Sanjay |