public class Pause extends Object
Does its best to handle sub-millisecond pauses. As of Java8 at least, TimeUnit.*.sleep() calls Thread.sleep(millis, nanos), which simply rounds up to millis + 1.
| Modifier and Type | Field and Description |
|---|---|
static int |
NANO_PRECISION |
| Constructor and Description |
|---|
Pause() |
| Modifier and Type | Method and Description |
|---|---|
static void |
micro(int us)
Pauses the given number of microseconds.
|
static void |
milli(int ms)
Pauses the given number of milliseconds.
|
static void |
nano(int ns)
Pauses the given number of nanoseconds.
|
static void |
second(int sec)
Pauses the given number of seconds.
|
public static void second(int sec)
sec - Number of seconds to pause.public static void milli(int ms)
ms - Number of milliseconds to pause.public static void micro(int us)
us - Number of microseconds to pause.public static void nano(int ns)
ns - Number of nanoseconds to pause.Copyright © 2018. All rights reserved.