Package org.testng.util
Class TimeUtils
- java.lang.Object
-
- org.testng.util.TimeUtils
-
public final class TimeUtils extends java.lang.Object
A Utility class that deals with time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TimeUtils.Task
A sample task to be executed.
-
Constructor Summary
Constructors Modifier Constructor Description private
TimeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
computeAndShowTime(java.lang.String msg, TimeUtils.Task task)
Helper method that can be used to compute the time.static java.lang.String
formatTimeInLocalOrSpecifiedTimeZone(long timeInMilliSeconds, java.lang.String format)
-
-
-
Method Detail
-
formatTimeInLocalOrSpecifiedTimeZone
public static java.lang.String formatTimeInLocalOrSpecifiedTimeZone(long timeInMilliSeconds, java.lang.String format)
- Parameters:
timeInMilliSeconds
- - The time in millisecondsformat
- - A format that can be used bySimpleDateFormat
- Returns:
- - A formatted string representation of the time in the timezone as obtained via
RuntimeBehavior.getTimeZone()
-
computeAndShowTime
public static void computeAndShowTime(java.lang.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
- - ATimeUtils.Task
that represents the task to be executed.
-
-