- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- change time man page
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
10-03-2008 02:04 AM
10-03-2008 02:04 AM
change time man page
The time utility (buitin and /bin/time) outputs the time command results with the format xx:yy.zz (where xx is in minutes, yy seconds, and zz in tenth of seconds) where its man pages says its output is in seconds.
It may be time to change the man page, or to change the time utility:
/bin/time sleep 75
real 1:15.0
user 0.0
sys 0.0
/bin/time -p sleep 75
real 1:15.0
user 0.0
sys 0.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 02:26 AM
10-03-2008 02:26 AM
Re: change time man page
Let for example if you do
time bdf
real 0.1 ( seconds )
user 0.0
sys 0.0
you can't say 0.1 minute to this.
Thanks
SKR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 02:28 AM
10-03-2008 02:28 AM
Re: change time man page
and how do you pronounce 1:15.0 ?
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 02:31 AM
10-03-2008 02:31 AM
Re: change time man page
SKR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 02:36 AM
10-03-2008 02:36 AM
Re: change time man page
> real 1:15.0
> user 0.0
> sys 0.0
1:15 => 1min:15 sec => 75 sec ... what is the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 02:44 AM
10-03-2008 02:44 AM
Re: change time man page
If we given
time sleep 75
Then output should be like this 75.0 seconds but its coming 1:15.0
SKR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 03:06 AM
10-03-2008 03:06 AM
Re: change time man page
# time sleep 55
real 55.0
user 0.0
sys 0.0
# time sleep 62
real 1:02.0
user 0.0
sys 0.0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 03:14 AM
10-03-2008 03:14 AM
Re: change time man page
This sounds a lot like arguing over the pronunciation of potato . . . . or of tomato.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 03:24 AM
10-03-2008 03:24 AM
Re: change time man page
Suppose you are looking at this string
1:15.0
How would you know if it is for "1 hour 15 minutes" or for " 1 minute 15 seconds"? Since you know that the precision is in seconds, you must treat 1:15.0 as 1m15s. If you wanted to write "1hour 15minutes" you would write "1:15:0.0".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 03:59 AM
10-03-2008 03:59 AM
Re: change time man page
My point was that my understanding of the man page (extract : Times are reported in seconds.) was supposed to give 75.0 instead of 1:15.0.
Not a major issue, but, I need to parse the result and transform it to seconds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 04:04 AM
10-03-2008 04:04 AM
Re: change time man page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 10:37 AM
10-03-2008 10:37 AM
Re: change time man page
real 45296.7
user 5678.9
sys 1744.0
would it be more useful? By common convention, the ":" character separates hours, minutes and seconds. Of course, there may be a different method used in a different country or language (see man environ, specifically LC_TIME). The time program always shows seconds until 59.9, then shows mins:secs until 59:59.9 and then shows hrs:mins:secs. Computers are quite happy with 45296.7 but humans are more comfortable with 12:34:56.7
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2008 12:11 PM
10-03-2008 12:11 PM
Re: change time man page
To add to Bill's discussion, here's a little Perl snippet to convert a time format of H:M:S.f to seconds:
# TIME=12:34:56.7
# echo ${TIME} | perl -nle '@t=reverse split /:/;for (1,60,3600) {$sec+=$t[$i]*$_;$i++};END{print $sec}'
45296.7
This works equally well for only minutes and seconds, too, like:
# TIME=3:11.8
# echo ${TIME} | perl ...
191.8
Regards!
...JRF...
Regards!
...JRF...