• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Time Conversion

 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 49472
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic