add basic metrics impl
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 2m32s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 2m32s
This commit is contained in:
19
src/main/java/xyz/mcutils/backend/common/Timer.java
Normal file
19
src/main/java/xyz/mcutils/backend/common/Timer.java
Normal file
@ -0,0 +1,19 @@
|
||||
package xyz.mcutils.backend.common;
|
||||
|
||||
public class Timer {
|
||||
|
||||
/**
|
||||
* Schedules a task to run after a delay.
|
||||
*
|
||||
* @param runnable the task to run
|
||||
* @param delay the delay before the task runs
|
||||
*/
|
||||
public static void scheduleRepeating(Runnable runnable, long delay, long period) {
|
||||
new java.util.Timer().scheduleAtFixedRate(new java.util.TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
runnable.run();
|
||||
}
|
||||
}, delay, period);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user