switch to nanoTime()

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2323 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2008-01-09 20:17:16 +00:00
parent e01cf72472
commit ed773cdf29
1 changed files with 6 additions and 3 deletions

View File

@ -19,6 +19,9 @@ public class Stopwatch {
private int count;
/**
* elapsed time in nanoseconds
*/
private long elapsedTime;
private long startTime;
@ -27,11 +30,11 @@ public class Stopwatch {
}
public void start() {
startTime = System.currentTimeMillis();
startTime = System.nanoTime();
}
public void stop() {
double endTime = System.currentTimeMillis();
long endTime = System.nanoTime();
count++;
elapsedTime += (endTime - startTime);
}
@ -40,7 +43,7 @@ public class Stopwatch {
* @return elapsed time in ms
*/
public long getElapsedMillis() {
return elapsedTime;
return elapsedTime / 1000000;
}
/**