Package org.testng.util
Class TimeUtils
- java.lang.Object
-
- org.testng.util.TimeUtils
-
public final class TimeUtils extends java.lang.ObjectA Utility class that deals with time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTimeUtils.TaskA sample task to be executed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcomputeAndShowTime(java.lang.String msg, TimeUtils.Task task)Helper method that can be used to compute the time.static java.lang.StringformatTimeInLocalOrSpecifiedTimeZone(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.Taskthat represents the task to be executed.
-
-