java.lang.Object
com.port80.util.SystemWatch
- public class SystemWatch
- extends java.lang.Object
Watch for system status (time, memory footprint, ... etc).
Usage:
SystemWatch t1=new SystemWatch().start();
t1.stop();
msg.println(t1.toString());
// Cumulate elapsed time, recalculate used memory size.
t1.start();
t1.stop();
// Reset elapsed time, recalculate used memory size.
t1.restart();
t1.stop();
format
private java.lang.String format
elapsed
private float elapsed
usedSize
private long usedSize
totalSize
private long totalSize
startTime
private long startTime
startSize
private long startSize
runtime
private java.lang.Runtime runtime
SystemWatch
public SystemWatch()
SystemWatch
public SystemWatch(java.lang.String format)
start
public SystemWatch start()
stop
public SystemWatch stop()
restart
public void restart()
reset
public void reset()
elapsed
public float elapsed()
size
public long size()
totalSize
public long totalSize()
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
main
public static void main(java.lang.String[] args)
test
private static void test()