/** * Checks how long till the next task will be ready to execute. If there are no tasks in this * scheduler currently then {@link Long#MAX_VALUE} will be returned. If there is a task ready * to execute this will return a value less than or equal to zero. If the task is past its * desired point of execution the result will be a negative amount of milliseconds past that * point in time. * <p> * Generally this is called from the same thread that would invoke * {@link #tick(ExceptionHandler)} (but does not have to be). Since this does not block or lock * if being invoked in parallel with {@link #tick(ExceptionHandler)}, the results may be no * longer accurate by the time this invocation has returned. * <p> * This can be useful if you want to know how long you can block on something, ASSUMING you can * detect that something has been added to the scheduler, and interrupt that blocking in order * to handle tasks. * * @return Milliseconds till the next task is ready to run */ public long getDelayTillNextTask() { return scheduler.getDelayTillNextTask(); }
/** * Checks how long till the next task will be ready to execute. If there are no tasks in this * scheduler currently then {@link Long#MAX_VALUE} will be returned. If there is a task ready * to execute this will return a value less than or equal to zero. If the task is past its * desired point of execution the result will be a negative amount of milliseconds past that * point in time. * <p> * Generally this is called from the same thread that would invoke * {@link #tick(ExceptionHandler)} (but does not have to be). Since this does not block or lock * if being invoked in parallel with {@link #tick(ExceptionHandler)}, the results may be no * longer accurate by the time this invocation has returned. * <p> * This can be useful if you want to know how long you can block on something, ASSUMING you can * detect that something has been added to the scheduler, and interrupt that blocking in order * to handle tasks. * * @return Milliseconds till the next task is ready to run */ public long getDelayTillNextTask() { return scheduler.getDelayTillNextTask(); }