Changed ImmediateExecutorTest to use nanoTime
This commit is contained in:
parent
d020ffe44c
commit
c4269c1697
@ -39,7 +39,7 @@ public class ImmediateExecutorTest {
|
||||
@Test
|
||||
public void shouldExecuteImmediately() {
|
||||
ImmediateExecutor e = ImmediateExecutor.INSTANCE;
|
||||
long startTime = System.currentTimeMillis();
|
||||
long startTime = System.nanoTime();
|
||||
e.execute(new Runnable() {
|
||||
public void run() {
|
||||
for (;;) {
|
||||
@ -50,8 +50,8 @@ public class ImmediateExecutorTest {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
assertTrue(System.currentTimeMillis() - startTime > 900);
|
||||
assertTrue(System.nanoTime() - startTime > 900000000L);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user