public final class Performance extends Object
Constructor and Description |
---|
Performance() |
Modifier and Type | Method and Description |
---|---|
static String |
format(long size)
Formats a number according to the binary size orders (KB, MB, ...).
|
static String |
format(long size,
boolean det)
Formats a file size according to the binary size orders (KB, MB, ...).
|
static void |
gc(int number)
Performs some garbage collection.
|
static String |
getMemory()
Returns a formatted representation of the current memory consumption.
|
String |
getTime()
Returns the measured execution time in milliseconds and reinitializes
the timer.
|
String |
getTime(int runs)
Returns the measured execution time in milliseconds, divided by the
number of runs, and reinitializes the timer.
|
static String |
getTime(long time,
int runs)
Returns a string with the measured execution time in milliseconds.
|
static long |
memory()
Returns the current memory consumption in bytes.
|
static void |
sleep(long ms)
Sleeps the specified number of milliseconds.
|
long |
time()
Returns the measured execution time in nanoseconds.
|
String |
toString() |
public long time()
public String getTime()
public String getTime(int runs)
runs
- number of runspublic static String getTime(long time, int runs)
time
- measured time in nanosecondsruns
- number of runspublic static String getMemory()
public static String format(long size)
size
- value to be formattedpublic static String format(long size, boolean det)
size
- file sizedet
- detailed suffixpublic static void sleep(long ms)
ms
- time in milliseconds to waitpublic static void gc(int number)
number
- number of times to execute garbage collectionpublic static long memory()
Copyright © 2005–2015 BaseX Team. All rights reserved.