Friday, 7 March 2014

TimeUnit class

TimeUnit is in java.util.concurrent package. It is used to represent time duration.

TimeUnit is of type enum and provides constants to represent Milliseconds, seconds, days etc.,

Constants
DAYS
HOURS
MICROSECONDS
MILLISECONDS
MINUTES
NANOSECONDS
SECONDS

Constant names are self explanatory

A nanosecond is defined as one thousandth of a microsecond, a microsecond as one thousandth of a millisecond, a millisecond as one thousandth of a second, a minute as sixty seconds, an hour as sixty minutes, and a day as twenty four hours.


Related Posts


Destroy Thread Group                                                 Get All TimeUnit constants                                                 Home

No comments:

Post a Comment