Add timeout monitor for Bluetooth connections.

This commit is contained in:
akwizgran
2020-05-08 14:19:43 +01:00
parent 78391c604b
commit 99adf37deb
19 changed files with 280 additions and 50 deletions

View File

@@ -16,6 +16,11 @@ 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,6 +17,11 @@ 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);