mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-04 11:50:34 -06:00
correct time base for await updates
This commit is contained in:
parent
625be1db16
commit
2d39aad2b1
@ -92,14 +92,14 @@ public class ScenariosExecutor {
|
||||
boolean isShutdown = false;
|
||||
|
||||
while (!isShutdown && System.currentTimeMillis() < timeoutAt) {
|
||||
long updateAt = Math.min(timeoutAt, System.currentTimeMillis() + updateInterval);
|
||||
long waitedAt = System.currentTimeMillis();
|
||||
long updateAt = Math.min(timeoutAt, waitedAt + updateInterval);
|
||||
while (!isShutdown && System.currentTimeMillis() < timeoutAt) {
|
||||
|
||||
while (!isShutdown && System.currentTimeMillis() < updateAt) {
|
||||
try {
|
||||
long timeRemaining = timeoutAt - System.currentTimeMillis();
|
||||
isShutdown = executor.awaitTermination(timeRemaining, TimeUnit.MICROSECONDS);
|
||||
long timeRemaining = updateAt - System.currentTimeMillis();
|
||||
isShutdown = executor.awaitTermination(timeRemaining, TimeUnit.MILLISECONDS);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user