Java TimeUnit Usage getDurationUnit(Map config)

Here you can find the source of getDurationUnit(Map config)

Description

get Duration Unit

License

Open Source License

Declaration

private static TimeUnit getDurationUnit(Map<String, Object> config) 

Method Source Code

//package com.java2s;

import java.util.Map;
import java.util.concurrent.TimeUnit;

public class Main {
    private static TimeUnit getDurationUnit(Map<String, Object> config) {
        String durationUnit = (String) config.getOrDefault("durationUnit", TimeUnit.SECONDS.name());
        return TimeUnit.valueOf(durationUnit.toUpperCase());
    }// w w  w . j a  v  a 2s .co  m
}

Related

  1. getDurationBreakdown(long millis)
  2. getDurationFromMillis(long millis)
  3. getDurationFromMilliseconds(long duration)
  4. getDurationFromTwoDates(Date startTime, Date endTime)
  5. getDurationHMS(long millis)
  6. getElapsedTime(Date start, Date end)
  7. getElapsedTimeString(long elapsed)
  8. getETA(final long seconds)
  9. getFormattedDiffTime(long timeFirst, long timeLast)