| Constructor and Description |
|---|
Threads() |
| Modifier and Type | Method and Description |
|---|---|
static long |
checkedWait(com.google.common.base.Stopwatch sw,
long timeout,
long sleep)
Check to make sure elapsed time on the stopwatch has not exceeded
timeout and then sleep for the indicated number of milliseconds |
static void |
join(List<Thread> threads)
Invoke join() on each thread
|
static long |
sleep(long millis)
Sleep for
millis |
static long |
sleep(com.google.common.base.Optional<? extends Number> millis)
Sleep for
millis or zero, if !millis.isPresent() |
static long |
sleep(String time)
Sleep for
time where time is in the format 15ms, 15s, 15m, 15h, 15d, 15y for 15 milliseconds, seconds, minutes, hours, days, and years, respectively. |
static void |
start(List<Thread> threads)
Start each thread
|
public Threads()
public static long checkedWait(com.google.common.base.Stopwatch sw, long timeout, long sleep)
timeout and then sleep for the indicated number of millisecondsIllegalStateException - if elapsed time on the stopwatch has exceeded timeout or if InterruptedException is thrown while sleepingpublic static long sleep(String time)
time where time is in the format 15ms, 15s, 15m, 15h, 15d, 15y for 15 milliseconds, seconds, minutes, hours, days, and years, respectively. Note that years
is approximate as the logic always assumes exactly 365 days a year.IllegalStateException - if interrupted.public static long sleep(com.google.common.base.Optional<? extends Number> millis)
millis or zero, if !millis.isPresent()IllegalStateException - if interrupted.public static long sleep(long millis)
millisIllegalStateException - if interrupted.Copyright © 2010–2014 The Kuali Foundation. All rights reserved.