mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-11 21:57:33 +00:00
17 lines
466 B
Java
17 lines
466 B
Java
package customskinloader.utils;
|
|||
|
|
|
||
|
|
public class TimeUtil {
|
||
|
|
public static long getCurrentUnixTimestamp(){
|
||
|
|
return System.currentTimeMillis()/1000l;
|
||
|
|
}
|
||
|
|
public static long getUnixTimestamp(long offset){
|
||
|
|
return getCurrentUnixTimestamp()+offset;
|
||
|
|
}
|
||
|
|
public static long getUnixTimestampRandomDelay(long offset){
|
||
|
|
return getCurrentUnixTimestamp()+offset+random(0,5);
|
||
|
|
}
|
||
|
|
|
||
|
|
private static int random(int min,int max){
|
||
|
|
return (int)(Math.random()*(max-min+1))+min;
|
||
|
|
}
|
||
|
|
}
|