Начинающий
Начинающий
- Статус
- Оффлайн
- Регистрация
- 8 Дек 2024
- Сообщения
- 26
- Реакции
- 1
Знаю у всех она есть и найти не так трудно но темы не видел так что пастеры скажут спасибо
TimerUtil:
TimerUtil:
Код:
package im.expensive.utils.math;
public class TimerUtil {
private long lastMS;
public TimerUtil() {
this.reset();
}
public boolean hasReached(double delay) {
return this.getTime() >= delay;
}
public long getTime() {
return System.currentTimeMillis() - this.lastMS;
}
public void reset() {
this.lastMS = System.currentTimeMillis();
}
public boolean hasTimeElapsed(long milliseconds) {
return System.currentTimeMillis() - lastMS >= milliseconds;
}
}