@LimitedPrivate({"HDFS","MapReduce"})
@Unstable
public final class Time
extends java.lang.Object
| Constructor | Description |
|---|---|
Time() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String |
formatTime(long millis) |
Convert time in millisecond to human readable format.
|
static long |
getUtcTime() |
Get the current UTC time in milliseconds.
|
static long |
monotonicNow() |
Current time from some arbitrary time base in the past, counting in
milliseconds, and not affected by settimeofday or similar system clock
changes.
|
static long |
monotonicNowNanos() |
Same as
monotonicNow() but returns its result in nanoseconds. |
static long |
now() |
Current system time.
|
public static long now()
public static long monotonicNow()
public static long monotonicNowNanos()
monotonicNow() but returns its result in nanoseconds.
Note that this is subject to the same resolution constraints as
System.nanoTime().public static java.lang.String formatTime(long millis)
millis - millisecond.public static long getUtcTime()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.