Package org.team1126.lib.util
Class Sleep
java.lang.Object
org.team1126.lib.util.Sleep
Utility class for sleeping the current thread,
with the option to skip if in simulation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidms(double ms) Sleeps the thread for the specified duration in milliseconds.static voidms(double ms, boolean skipSim) Sleeps the thread for the specified duration in milliseconds.static voidof(edu.wpi.first.units.measure.Time time) Sleeps the thread for the specified duration.static voidof(edu.wpi.first.units.measure.Time time, boolean skipSim) Sleeps the thread for the specified duration.static voidseconds(double seconds) Sleeps the thread for the specified duration in seconds.static voidseconds(double seconds, boolean skipSim) Sleeps the thread for the specified duration in seconds.
-
Method Details
-
of
public static void of(edu.wpi.first.units.measure.Time time) Sleeps the thread for the specified duration. Will always run, even if in simulation.- Parameters:
time- The time to sleep for.
-
of
public static void of(edu.wpi.first.units.measure.Time time, boolean skipSim) Sleeps the thread for the specified duration.- Parameters:
time- The time to sleep for.skipSim- If the thread should skip sleeping if in simulation.
-
seconds
public static void seconds(double seconds) Sleeps the thread for the specified duration in seconds. Will always run, even if in simulation.- Parameters:
seconds- The time to sleep for in seconds.
-
seconds
public static void seconds(double seconds, boolean skipSim) Sleeps the thread for the specified duration in seconds.- Parameters:
seconds- The time to sleep for in seconds.skipSim- If the thread should skip sleeping if in simulation.
-
ms
public static void ms(double ms) Sleeps the thread for the specified duration in milliseconds. Will always run, even if in simulation.- Parameters:
ms- The time to sleep for in milliseconds.
-
ms
public static void ms(double ms, boolean skipSim) Sleeps the thread for the specified duration in milliseconds.- Parameters:
ms- The time to sleep for in milliseconds.skipSim- If the thread should skip sleeping if in simulation.
-