mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Wrapped System.currentTimeMillis() and Thread.sleep() for testability.
This commit is contained in:
@@ -8,4 +8,7 @@ public interface Clock {
|
||||
|
||||
/** @see {@link java.lang.System#currentTimeMillis()} */
|
||||
long currentTimeMillis();
|
||||
|
||||
/** @see {@link java.lang.Thread.sleep(long)} */
|
||||
void sleep(long milliseconds) throws InterruptedException;
|
||||
}
|
||||
|
||||
@@ -6,4 +6,8 @@ public class SystemClock implements Clock {
|
||||
public long currentTimeMillis() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void sleep(long milliseconds) throws InterruptedException {
|
||||
Thread.sleep(milliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user