|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.common.utils.TimeUtils
public class TimeUtils
Various utilities for waiting some time.
Field Summary | |
---|---|
static long |
DAY_IN_HOURS
Constant for the number of hours per day: 24. |
static long |
HOUR_IN_MINUTES
Constant for the number of minutes per hour: 60. |
static long |
MINUTE_IN_SECONDS
Constant for the number of seconds per minute: 60. |
static long |
SECOND_IN_MILLIS
Constant for the number of milliseconds per second: 1000. |
static long |
WEEK_IN_DAYS
Constant for the number of days per week: 7. |
Constructor Summary | |
---|---|
TimeUtils()
|
Method Summary | |
---|---|
static void |
exponentialBackoffSleep(int attempt)
Sleep for an exponentially backing off amount of time, in milliseconds. |
static void |
exponentialBackoffSleep(int attempt,
int timeunit)
Sleep for an exponentially backing off amount of time. |
static java.lang.String |
readableTimeInterval(long millis)
Method for translating a time in milliseconds to a human readable String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long SECOND_IN_MILLIS
public static final long MINUTE_IN_SECONDS
public static final long HOUR_IN_MINUTES
public static final long DAY_IN_HOURS
public static final long WEEK_IN_DAYS
Constructor Detail |
---|
public TimeUtils()
Method Detail |
---|
public static void exponentialBackoffSleep(int attempt)
attempt
- The attempt number, which is the log2 of the number of
milliseconds spent asleep.public static void exponentialBackoffSleep(int attempt, int timeunit)
attempt
- The attempt number, which is the log2 of the number of
timeunits spent asleep.timeunit
- the specified timeunit in miliseconds
ArgumentNotValid
- if timeunit is unsupported.public static java.lang.String readableTimeInterval(long millis)
millis
- The amount of milliseconds.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |