code: public static Duration of(String duration) {
      Matcher matcher = PATTERN.matcher(duration);
      Assert.arg(matcher.matches(), "Invalid duration: %s", duration);
  
      if (matcher.group(1) != null) {
        return Duration.ofSeconds(Long.MAX_VALUE);
      } else {
        String unit = matcher.group(4);
        String value = matcher.group(3);
        return Duration.ofNanos(TimeUnit.NANOSECONDS.convert(Long.parseLong(value),
            unit == null ? TimeUnit.MILLISECONDS : SUFFIXES.get(unit)));
      }
    }
docs: Returns a Duration from the parsed {@code duration}. Example:
  
  <pre>
  5
  5 s
  5 seconds
  10m
  10 minutes
  </pre>
  
  <p>
  If a unit is not given, the default unit will be milliseconds.