Use milliseconds for timing.

This commit is contained in:
akwizgran
2020-05-11 15:42:23 +01:00
parent c4273d22ed
commit c80d3196af
8 changed files with 12 additions and 37 deletions

View File

@@ -11,11 +11,6 @@ public interface Clock {
*/
long currentTimeMillis();
/**
* @see System#nanoTime()
*/
long nanoTime();
/**
* @see Thread#sleep(long)
*/

View File

@@ -16,11 +16,6 @@ public class ArrayClock implements Clock {
return times[index++];
}
@Override
public long nanoTime() {
return times[index++] * 1_000_000;
}
@Override
public void sleep(long milliseconds) throws InterruptedException {
Thread.sleep(milliseconds);

View File

@@ -17,11 +17,6 @@ public class SettableClock implements Clock {
return time.get();
}
@Override
public long nanoTime() {
return time.get() * 1_000_000;
}
@Override
public void sleep(long milliseconds) throws InterruptedException {
Thread.sleep(milliseconds);