- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Time difference between two date command, How?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 11:55 AM
04-08-2002 11:55 AM
I have a script that runs for couple minutes to couple hours. I am trying to find out total time this script runs.
I have put a variable start_time=`date` at the begining of the script and end_time=`date` at the end. From this How can I get the total time.
Sachin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 11:58 AM
04-08-2002 11:58 AM
Re: Time difference between two date command, How?
Did you think of the command "timex"?.
timex script
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:00 PM
04-08-2002 12:00 PM
Re: Time difference between two date command, How?
I was thinking the same thing!
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:01 PM
04-08-2002 12:01 PM
Re: Time difference between two date command, How?
I've used this in the past ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:01 PM
04-08-2002 12:01 PM
SolutionSTART=$(perl -e 'print time;')
do your stuff
FINISH=$(perl -e 'print time;')
These will return the time in epoch seconds; the elasped time is simply the difference between them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:09 PM
04-08-2002 12:09 PM
Re: Time difference between two date command, How?
timex < command > will give you the total time in terms of real usr system taken by the command.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:22 PM
04-08-2002 12:22 PM
Re: Time difference between two date command, How?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:22 PM
04-08-2002 12:22 PM
Re: Time difference between two date command, How?
echo Total elasped time in seconds = $SECONDS
This is a built in variable that starts at zero when the script (or shell) starts. You can echo this at any point in the script to get elapsed time so far in the execution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:28 PM
04-08-2002 12:28 PM
Re: Time difference between two date command, How?
I am using perl now. It is working fine. I have read your previous answer (Same command) regarding some time question but It didn't make me sense there.
Sachin