TimeUnit toMicros() method in Java with Examples
The toMicros() method of TimeUnit Class is used to get the time represented by the TimeUnit object, as the number of MicroSeconds, since midnight UTC on the 1st January 1970.
public long toMicros(long duration)
Parameters: This method accepts a mandatory parameter duration which is the duration in milliSeconds.
Return Value: This method returns the converted duration as MicroSeconds.
Below program illustrate the implementation of TimeUnit toMicros() method:
Time 1539585538596 milliSeconds in MicroSeconds = 1539585538596000
Time 1539585540908 milliSeconds in MicroSeconds = 1539585540908000
My Personal Notes arrow_drop_up
Please Login to comment...