Class TimeUtils

java.lang.Object
org.testng.util.TimeUtils

public final class TimeUtils extends Object
A Utility class that deals with time.
  • Method Details

    • formatTimeInLocalOrSpecifiedTimeZone

      public static String formatTimeInLocalOrSpecifiedTimeZone(long timeInMilliSeconds, String format)
      Parameters:
      timeInMilliSeconds - - The time in milliseconds
      format - - A format that can be used by SimpleDateFormat
      Returns:
      - A formatted string representation of the time in the timezone as obtained via RuntimeBehavior.getTimeZone()
    • computeAndShowTime

      public static void computeAndShowTime(String msg, TimeUtils.Task task)
      Helper method that can be used to compute the time.
      Parameters:
      msg - - A user friendly message to be shown in the logs.
      task - - A TimeUtils.Task that represents the task to be executed.