Changed ImmediateExecutorTest to use nanoTime

This commit is contained in:
Trustin Lee 2009-03-16 03:59:31 +00:00
parent d020ffe44c
commit c4269c1697

View File

@ -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);
}
}