java TimeUnit.SECONDS与TimeUnit.MILLISECONDS区别
TimeUnit.SECONDS(5)线程等待五秒
TimeUnit.MILLISECONDS(5000)线程等待五秒.
两者的时间单位不一样。
内部都是Thread.sleep实现。
public static TimeUnit toTimeUnit(final HBaseProtos.TimeUnit proto) { switch (proto) { case NANOSECONDS: return TimeUnit.NANOSECONDS; case MICROSECONDS: return TimeUnit.MICROSECONDS; case MILLISECONDS: return TimeUnit.MILLISECONDS; case SECONDS: return TimeUnit.SECONDS; case MINUTES: return TimeUnit.MINUTES; case HOURS: return TimeUnit.HOURS; case DAYS: return TimeUnit.DAYS; default: throw new RuntimeException("Invalid TimeUnit " + proto); } }