List of usage examples for java.time Duration parse
public static Duration parse(CharSequence text)
From source file:org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.java
private static long parseDelayAsLong(String value) throws RuntimeException { if (value.length() > 1 && (isP(value.charAt(0)) || isP(value.charAt(1)))) { return Duration.parse(value).toMillis(); }/* www. j a v a 2s . co m*/ return Long.parseLong(value); }