|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.basex.util.Performance
public final class Performance
This class contains methods for performance measurements.
| Constructor Summary | |
|---|---|
Performance()
Constructor, initializing the performance timer. |
|
| Method Summary | |
|---|---|
static java.lang.String |
formatSize(long size)
Formats a number according to the binary size orders (KB, MB, ...). |
static java.lang.String |
formatSize(long size,
boolean det)
Formats a file size according to the binary size orders (KB, MB, ...). |
static void |
gc(int n)
Perform some garbage collection. |
static java.lang.String |
getMem()
Returns a formatted representation of the current memory consumption. |
long |
getTime()
Returns the measured execution time in nanoseconds. |
java.lang.String |
getTimer()
Returns the measured execution time in milliseconds and reinitializes the timer. |
java.lang.String |
getTimer(int runs)
Returns the measured execution time in milliseconds, divided by the number of runs, and reinitializes the timer. |
static java.lang.String |
getTimer(long time,
int runs)
Returns a string with the measured execution time in milliseconds. |
void |
initTimer()
Initializes the timer. |
static void |
sleep(int ms)
Sleeps the specified number of milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Performance()
| Method Detail |
|---|
public static java.lang.String formatSize(long size)
size - value to be formatted
public static java.lang.String formatSize(long size,
boolean det)
size - file sizedet - detailed suffix
public static void gc(int n)
n - number of times to execute garbage collectionpublic static java.lang.String getMem()
public long getTime()
public java.lang.String getTimer()
public java.lang.String getTimer(int runs)
runs - number of runs
public static java.lang.String getTimer(long time,
int runs)
time - measured time in nanosecondsruns - number of runs
public void initTimer()
public static void sleep(int ms)
ms - time in milliseconds to wait
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||