You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
560 B
Java

Timer
public final class Timer {
private long time = 0L;
static private Timer timer = null;
private Timer() {
time = -System.currentTimeMillis();
};
static public Timer getInstance() {
if(timer == null) timer = new Timer();
return timer;
};
public final String toString() {
time += System.currentTimeMillis();
return new StringBuffer(getClass().getName()).append(": [").append(time).append(" ms]").toString();
};
};;