Source Code : Stop watch with nano second
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Stop watch with nano second
public class StopWatch {
public final long t0 = System.currentTimeMillis();
public final long n0 = System.nanoTime();
static public StopWatch start() {
return new StopWatch();
}
public long millisEllapsed() {
return System.currentTimeMillis() - t0;
}
public double secondsEllapsed() {
return millisEllapsed() / 1000.0;
}
public long nanoEllapsed() {
return System.nanoTime() - n0;
}
}
Thank with us