public class TimeProfiler extends Object implements ComparableProfiler
Modifier and Type | Class and Description |
---|---|
static class |
TimeProfiler.TimeBase
The time base.
|
Constructor and Description |
---|
TimeProfiler() |
Modifier and Type | Method and Description |
---|---|
long |
compare(long start,
long end)
Compare two values, the value returned will then be used by
Profiler.printValue(long) . |
static TimeProfiler.TimeBase |
getBase()
Gets the
TimeProfiler.TimeBase for the printValue(long) . |
long |
getCurrentValue()
Gets the current value.
|
String |
getName()
Gets the profiler's name.
|
boolean |
isBiggerPrinted(long v1,
long v2)
Checks whether a value will appear bigger than another once printed.
|
String |
printValue(long value)
Prints a value with its unit.
|
static void |
setBase(TimeProfiler.TimeBase base)
Sets the
TimeProfiler.TimeBase for the printValue(long) . |
public long compare(long start, long end)
ComparableProfiler
Profiler.printValue(long)
.compare
in interface ComparableProfiler
start
- the initial value.end
- the final value.public static TimeProfiler.TimeBase getBase()
TimeProfiler.TimeBase
for the printValue(long)
.public long getCurrentValue()
Profiler
getCurrentValue
in interface Profiler
public String getName()
Profiler
public boolean isBiggerPrinted(long v1, long v2)
Profiler
isBiggerPrinted
in interface Profiler
v1
- the first valuev2
- the second valuetrue
if v1 will look > v2.Profiler.printValue(long)
public String printValue(long value)
Profiler
printValue
in interface Profiler
value
- the value received from Profiler.getCurrentValue()
.public static void setBase(TimeProfiler.TimeBase base)
TimeProfiler.TimeBase
for the printValue(long)
.base
- the base to set.