public abstract class TimeTaken extends Object
| Modifier and Type | Field and Description |
|---|---|
protected long |
end |
int |
flag |
String |
name |
protected long |
size |
long |
start |
| Constructor and Description |
|---|
TimeTaken(String name,
int flag)
The name is as it will appear when written to output (abstract method)
The flag is an integer which can be System type (XML, REMOTE, etc), or End User defined for reporting purposes
|
| Modifier and Type | Method and Description |
|---|---|
void |
done()
Call this when process is done to state ending time.
|
long |
end()
Give readonly access to End, which isn't final
|
float |
millis()
Time is taken in NanoSeconds.
|
abstract void |
output(StringBuilder sb)
Write self to a String Builder (for making Audits)
|
void |
size(long theSize)
For sizable contents, set the size.
|
String |
toString()
For Debugging
|
public final long start
protected long end
protected long size
public final int flag
public final String name
public TimeTaken(String name, int flag)
name - flag - public void done()
It is exceedingly prudent to wrap the process called with a try-finally:
TimeTaken tt = env.startSubTime();
try {
process.me(); // code to be timed.
} finally {
tt.done();
}
public void size(long theSize)
size - public long end()
public float millis()
public abstract void output(StringBuilder sb)
sb - Copyright © 2017. All rights reserved.