This commit is contained in:
Cloudburst
2021-06-12 19:54:43 +02:00
parent 0ca7ec87dd
commit 2d1381a648
5 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package cloudburst.rejects.utils;
import java.util.Timer;
import java.util.TimerTask;
public class Utils {
public static int CPS = 0;
public static void init() {
new Timer().scheduleAtFixedRate(newTimerTaskFromLambda(() -> CPS = 0), 0, 1000);
}
public static TimerTask newTimerTaskFromLambda(Runnable runnable)
{
return new TimerTask()
{
@Override
public void run()
{
runnable.run();
}
};
}
}