public class MathUtils
extends java.lang.Object
| Constructor and Description |
|---|
MathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static long |
elapsedMicroSec(long startNanoTime)
Microseconds elapsed since the time specified, the input is nanoTime
the only conversion happens when computing the elapsed time.
|
static long |
elapsedMSec(long startNanoTime)
Milliseconds elapsed since the time specified, the input is nanoTime
the only conversion happens when computing the elapsed time.
|
static long |
elapsedNanos(long startNanoTime)
Nanoseconds elapsed since the time specified, the input is nanoTime
the only conversion happens when computing the elapsed time.
|
static int |
findNextPositivePowerOfTwo(int value) |
static long |
nowInNano()
Current time from some arbitrary time base in the past, counting in
nanoseconds, and not affected by settimeofday or similar system clock
changes.
|
static int |
signSafeMod(long dividend,
int divisor) |
public static int signSafeMod(long dividend,
int divisor)
public static int findNextPositivePowerOfTwo(int value)
public static long nowInNano()
NOTE: only use it for measuring. http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#nanoTime%28%29
public static long elapsedMSec(long startNanoTime)
startNanoTime - the start of the interval that we are measuringpublic static long elapsedMicroSec(long startNanoTime)
startNanoTime - the start of the interval that we are measuringpublic static long elapsedNanos(long startNanoTime)
startNanoTime - the start of the interval that we are measuringCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.