mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-24 18:44:26 +00:00
18 lines
512 B
Java
18 lines
512 B
Java
package noppes.npcs.util;
|
|
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
public class CustomNPCsScheduler {
|
|
private final static ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
|
|
|
|
public static void runTack(Runnable task, int delay){
|
|
executor.schedule(task, delay, TimeUnit.MILLISECONDS);
|
|
}
|
|
|
|
public static void runTack(Runnable task){
|
|
executor.schedule(task, 0, TimeUnit.MILLISECONDS);
|
|
}
|
|
}
|