Skip to content

seailz/SchedulerAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SchedulerAPI

Simple API for scheduling tasks - here's how to use it.

Reapting Tasks

SchedulerAPI.scheduleRepeat(() -> 
    System.out.println("Hello world, it's been a second!");
), 1000);

This method allows you to schedule a repeating task with an interval.

Repeating Task if Condition

boolean condition = true;
int i = 0;

scheduleRepeatIfTrue(() -> {
   System.out.println(i);
   i++;
}, 1000, () -> condition);

This method allows you to schedule a repeating task with an interval if a condition is true.

Schedule After

SchedulerAPI.scheduleAfter(() -> {
   System.out.println("Hello world, it's been a second!");
}, 1000);

This method will execute a task after a specific amount of time.

Schedule After if Condition

boolean condition = true;
SchedulerAPI.scheduleAfter(() -> {
   System.out.println("Hello world, it's been a second!");
}, 1000, () -> condition);

This method will execute a task after a specific amount of time if a condition is true.