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