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