code: @FFDCIgnore(Exception.class)
      public static long parseDuration(Object configAlias, String propertyKey, Object obj, long defaultValue, TimeUnit units) {
          if (obj != null) {
              try {
                  if (obj instanceof String)
                      return evaluateDuration((String) obj, units);
                  else if (obj instanceof Long)
                      return (Long) obj;
              } catch (Exception e) {
                  Tr.warning(tc, "invalidDuration", configAlias, propertyKey, obj);
                  throw new IllegalArgumentException("Duration value could not be parsed: key=" + propertyKey + ", value=" + obj, e);
              }
  
              // unknown type
              Tr.warning(tc, "invalidDuration", configAlias, propertyKey, obj);
              throw new IllegalArgumentException("Duration value could not be parsed: key=" + propertyKey + ", value=" + obj);
          }
  
          return defaultValue;
      }
docs: Parse a duration from the provided config value: checks for whether or not
  the object read from the Service/Component configuration is a String
  or a Metatype converted long duration value
  <p>
  If an exception occurs converting the object parameter:
  A translated warning message will be issued using the provided propertyKey and object
  as parameters. FFDC for the exception is suppressed: Callers should handle the thrown
  IllegalArgumentException as appropriate.
  
  @param configAlias
  Name of config (pid or alias) associated with a registered service
  or DS component.
  @param propertyKey
  The key used to retrieve the property value from the map.
  Used in the warning message if the value is badly formed.
  @param obj
  The object retrieved from the configuration property map/dictionary.
  @param defaultValue
  The default value that should be applied if the object is null.
  @param units
  The unit of time for the duration value. This is only used when
  converting from a String value.
  
  @return Long parsed/retrieved from obj, or default value if obj is null
  @throws IllegalArgumentException If value is not a String/Short/Integer/Long, or if an error
  occurs while converting/casting the object to the return parameter type.