jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes Time Conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Time Conversion" Watch "Time Conversion" New topic

Time Conversion

Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165
I face problems when specifying the time in milliseconds,nanosecondsfor sleep()

please let me know:
1 second =? milliseconds
1 second =? nanoseconds
1 millisec =? nanoseconds
1 min = ? millisec
1 min =? nanosec

akhilesh pandey

Joined: Jun 03, 2008
Posts: 17
I think its littl mathematical
milli =ten raise to -3 and
nano=ten raise to-9.

So 1sec=1000 millisec.
and 1 sec=10 raise to 9 nanosec.

Similary you can do the rest all calculations.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38020
Originally posted by Phillipe Rodrigues:
please let me know:
1 second = 1000 milliseconds
1 second = 1,000,000,000 nanoseconds
1 millisec = 1,000,000 nanoseconds
1 min = 60*1000 = 60,000 millisec
1 min = 60*1,000,000,000 = 60,000,000,000 nanosec
Using commas as thousand separators in the British and North American custom.

[edit]I presume you are using the TimeUnit enum?[/edit]
[ June 04, 2008: Message edited by: Campbell Ritchie ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Time Conversion
Similar Threads
Comparing Date and Timestamp: unexpected result
block timer
java.util.date into java.sql.timestamp
sample program which will prompt the user to enter the message along with the time, a
How i get execution time in java???