Package jetbrains.buildServer.util
Class TimeIntervalAction
- java.lang.Object
-
- jetbrains.buildServer.util.TimeIntervalAction
-
public class TimeIntervalAction extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TimeIntervalAction(long delayMs)
TimeIntervalAction(long delayMs, java.lang.Runnable defaultAction)
TimeIntervalAction(java.util.function.LongSupplier delaySupplier)
TimeIntervalAction(java.util.function.LongSupplier delaySupplier, java.lang.Runnable defaultAction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
execute()
Executes default action if time passed and does nothing otherwiseboolean
executeCustomAction(java.lang.Runnable action)
Executes the specified action if time passed and does nothing otherwiselong
getExecutionsCount()
long
getLastActionTime()
Returns timestamp of the last action execution.long
getTotalActionElapsedTimeMillis()
void
resetLastActionTime()
-
-
-
Constructor Detail
-
TimeIntervalAction
public TimeIntervalAction(long delayMs, @NotNull java.lang.Runnable defaultAction)
-
TimeIntervalAction
public TimeIntervalAction(@NotNull java.util.function.LongSupplier delaySupplier, @NotNull java.lang.Runnable defaultAction)
-
TimeIntervalAction
public TimeIntervalAction(@NotNull java.util.function.LongSupplier delaySupplier)
-
TimeIntervalAction
public TimeIntervalAction(long delayMs)
-
-
Method Detail
-
execute
public boolean execute()
Executes default action if time passed and does nothing otherwise- Returns:
- true if action was executed
-
executeCustomAction
public boolean executeCustomAction(@NotNull java.lang.Runnable action)
Executes the specified action if time passed and does nothing otherwise- Returns:
- true if action was executed
-
resetLastActionTime
public void resetLastActionTime()
-
getLastActionTime
public long getLastActionTime()
Returns timestamp of the last action execution.- Returns:
-
getExecutionsCount
public long getExecutionsCount()
-
getTotalActionElapsedTimeMillis
public long getTotalActionElapsedTimeMillis()
- Returns:
- returns total time spent on action execution.
-
-