Class TimeUtils
java.lang.Object
io.micrometer.core.instrument.util.TimeUtils
Modification on
TimeUnit.convert(long, TimeUnit)
that accepts and preserves
precision from a double
argument.-
Method Summary
Modifier and TypeMethodDescriptionstatic double
static double
daysToUnit
(double days, TimeUnit destinationUnit) static String
static double
hoursToUnit
(double hours, TimeUnit destinationUnit) static double
microsToUnit
(double micros, TimeUnit destinationUnit) static double
millisToUnit
(double millis, TimeUnit destinationUnit) static double
minutesToUnit
(double minutes, TimeUnit destinationUnit) static double
nanosToUnit
(double nanos, TimeUnit destinationUnit) static double
secondsToUnit
(double seconds, TimeUnit destinationUnit) static Duration
simpleParse
(String time) Deprecated.
-
Method Details
-
convert
-
nanosToUnit
-
microsToUnit
-
millisToUnit
-
secondsToUnit
-
minutesToUnit
-
hoursToUnit
-
daysToUnit
-
simpleParse
Deprecated.UseDurationValidator.validate(String, String)
instead since 1.5.0.- Parameters:
time
- A time string ending in human readable suffixes like 'ns', 'ms', 's'.- Returns:
- A duration
-
format
-
DurationValidator.validate(String, String)
instead since 1.5.0.