Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.util
Class SystemWatch  view SystemWatch download SystemWatch.java

java.lang.Object
  extended bycom.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();


Field Summary
private  float elapsed
           
private  java.lang.String format
           
private  java.lang.Runtime runtime
           
private  long startSize
           
private  long startTime
           
private  long totalSize
           
private  long usedSize
           
 
Constructor Summary
SystemWatch()
           
SystemWatch(java.lang.String format)
           
 
Method Summary
 float elapsed()
           
static void main(java.lang.String[] args)
           
 void reset()
           
 void restart()
           
 long size()
           
 SystemWatch start()
           
 SystemWatch stop()
           
private static void test()
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 long totalSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

SystemWatch

public SystemWatch()

SystemWatch

public SystemWatch(java.lang.String format)
Method Detail

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()