Add a new method to the DelayedExecutor

This commit is contained in:
Aria 2023-04-14 07:05:21 -07:00
parent 5ebe6eb78a
commit 812b525460

View file

@ -60,6 +60,21 @@ public class DelayedExecutorService {
//EXECUTORS.add(exe);
}
public void scheduleRepeating(final Runnable run, int seconds)
{
if(!Terminal.isRunning()) return;
TimerTask task = new TimerTask() {
@Override
public void run() {
run.run();
scheduleRepeating(run, seconds);
}
};
repeater.schedule(task, seconds*1000L);
}
private static void stopRepeatingThread()
{
repeater.cancel();