Here you can find the source of shortName(TimeUnit unit)
public static String shortName(TimeUnit unit)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; public class Main { public static String shortName(TimeUnit unit) { switch (unit) { case NANOSECONDS: return "ns"; case MICROSECONDS: return "us"; case MILLISECONDS: return "ms"; case SECONDS: return "s"; case MINUTES: return "m"; case HOURS: return "h"; case DAYS: return "days"; default://from w w w . j a v a 2 s.com return unit.toString(); } } }