package testTimer;
import java.util.Timer;
public class timer {
public static void main (String[] args) {
new Timer().scheduleAtFixedRate(new qtask(), 0, 1000);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public class Singleton {
private static Singleton Stopwatch;
private Singleton () {};
public static Singleton getInstance() {
if (Stopwatch == null) {
Stopwatch = new Singleton();
}
return Stopwatch;
}
}