Made sure the sleeping Runnable in ImmediateExecutorTest sleeps more than 1 sec
This commit is contained in:
parent
cceab617b0
commit
acf7a9d46f
@ -42,13 +42,16 @@ public class ImmediateExecutorTest {
|
|||||||
long startTime = System.nanoTime();
|
long startTime = System.nanoTime();
|
||||||
e.execute(new Runnable() {
|
e.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
long startTime = System.nanoTime();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
break;
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// Ignore
|
// Ignore
|
||||||
}
|
}
|
||||||
|
if (System.nanoTime() - startTime >= 1000000000L) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user