- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to get milli-second
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-27-2003 04:11 AM
10-27-2003 04:11 AM
Could anybody point to me what is the command to get system time upto milli-second, "date" can only go as deep as second, I need to do some more precise calculation based on time stamp I can get.
thanks,
Gary
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2003 04:16 AM
10-27-2003 04:16 AM
Re: how to get milli-second
There may well be a script that can calculate it based on the system time.
Of course, I reserve the right to be totally misinformed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2003 04:18 AM
10-27-2003 04:18 AM
Re: how to get milli-second
here is a thread that does with oracle: check it out:
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0x464e7b8d1de3d5118ff40090279cd0f9%2C00.html&admit=716493758+1067274938940+28353475
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2003 04:21 AM
10-27-2003 04:21 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2003 04:24 AM
10-27-2003 04:24 AM
Re: how to get milli-second
public class TimeZoneClock {
public static void main(String[] args) {
long nowMillis = System.currentTimeMillis();
System.out.println("current time in milliseconds: " + nowMillis);
Calendar cal = Calendar.getInstance();
System.out.println("Default TimeZone: " + cal.getTimeZone().getDisplayName() + " - " + cal.getTimeZone().getID());
System.out.println();
cal.setTime(new Date(nowMillis));
System.out.println("default TimeZone: " + cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND));
System.out.println();
cal.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
System.out.println("America/Los_Angeles: " + cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND));
System.out.println();
cal.setTimeZone(TimeZone.getTimeZone("America/Phoenix"));
System.out.println("America/Phoenix: " + cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND));
System.out.println();
cal.setTimeZone(TimeZone.getTimeZone("America/Denver"));
System.out.println("America/Denver: " + cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND));
System.out.println();
cal.setTimeZone(TimeZone.getTimeZone("America/Chicago"));
System.out.println("America/Chicago: " + cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND));
System.out.println();
cal.setTimeZone(TimeZone.getTimeZone("America/New_York"));
System.out.println("America/New_York: " + cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND));
System.out.println();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2003 04:26 AM
10-27-2003 04:26 AM
Re: how to get milli-second
------------------------
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2003 04:33 AM
10-27-2003 04:33 AM
Re: how to get milli-second
Refer to the foll. links for info.
http://www.maths.lth.se/help/R/.R/library/R.lang/html/System.currentTimeMillis.html
http://www.mvps.org/directx/articles/selecting_timer_functions.htm
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/J2771-90010/J2771-90010_top.html&con=/hpux/onlinedocs/J2771-90010/00/00/73-con.html&toc=/hpux/onlinedocs/J2771-90010/00/00/73-toc.html&searchterms=time%7cin%7cmilliseconds%7csystem&queryid=20031027-103032
HTH.
Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2003 05:13 AM
10-27-2003 05:13 AM
Re: how to get milli-second
As Clay pointed out, either C of java, the overhead of forking process does count, so I may do it through pure programming language instead of scripts.
thanks,
Gary