public final class ThreadUtils extends Object
Constructor and Description |
---|
ThreadUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
sleep(Duration duration)
Sleeps for a guaranteed minimum duration unless interrupted.
|
public ThreadUtils()
public static void sleep(Duration duration) throws InterruptedException
This method exists because Thread.sleep(100) can sleep for 0, 70, 100 or 200ms or anything else it deems appropriate. Read
Thread.sleep(long, int)
} for further interesting details.
duration
- the sleep duration.InterruptedException
- if interruptedThread.sleep(long, int)
Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.