Java Codes
Beginners
Core Java
Date Time
Java2D
Java Applets
Java AWT
Mathematics
Networking
Servlets
Session
Sound
Swing
Threads
Util Package
JDBC
Learning
Other
Security
XML
Java > Java Util Package sample source codes
Timer
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(); }; };;
Privacy Policy
|
Link to Us
|
Links