Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
blog scheduler
@Override
void run()
{
while(true)
{
Thread.sleep(job.getNextExecutionTime() - currentTime());
job.execute();
job.setNextExecutionTime(currentTime() + job.getExecutionInterval());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment