481 |
|
} |
482 |
|
|
483 |
|
/** |
484 |
< |
* Returns a new Date instance representing a time delayMillis |
485 |
< |
* milliseconds in the future. |
484 |
> |
* Returns a new Date instance representing a time at least |
485 |
> |
* delayMillis milliseconds in the future. |
486 |
|
*/ |
487 |
|
Date delayedDate(long delayMillis) { |
488 |
< |
return new Date(System.currentTimeMillis() + delayMillis); |
488 |
> |
// Add 1 because currentTimeMillis is known to round into the past. |
489 |
> |
return new Date(System.currentTimeMillis() + delayMillis + 1); |
490 |
|
} |
491 |
|
|
492 |
|
/** |