Class TimeUtils

java.lang.Object
com.netflix.genie.common.util.TimeUtils

public final class TimeUtils extends Object
Utility methods for dealing with time. Particularly duration.
Since:
3.0.0
  • Method Details

    • getDuration

      public static Duration getDuration(@Nullable Instant started, @Nullable Instant finished)
      Get the duration between when something was started and finished.
      Parameters:
      started - The start time. Can be null will automatically set the duration to 0
      finished - The finish time. If null will use (current time - started time) to get the duration
      Returns:
      The duration or zero if no duration