Package org.wpilib.commands3
Interface SchedulerEvent
- All Known Implementing Classes:
SchedulerEvent.Canceled,SchedulerEvent.Completed,SchedulerEvent.CompletedWithError,SchedulerEvent.Interrupted,SchedulerEvent.Mounted,SchedulerEvent.Scheduled,SchedulerEvent.Yielded
public sealed interface SchedulerEvent
permits SchedulerEvent.Scheduled, SchedulerEvent.Mounted, SchedulerEvent.Yielded, SchedulerEvent.Completed, SchedulerEvent.CompletedWithError, SchedulerEvent.Canceled, SchedulerEvent.Interrupted
An event that occurs during scheduler processing. This can range from
a command
being scheduled by a trigger or manual call to Scheduler.schedule(Command) to a command being interrupted by another. Event listeners can be registered with a
scheduler via Scheduler.addEventListener(Consumer). All events have a timestamp to
indicate when the event occurred.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordAn event marking when a command was canceled.static final recordAn event marking when a command completed naturally.static final recordAn event marking when a command threw or encountered an unhanded exception.static final recordAn event marking when a command was interrupted by another.static final recordAn event marking when a command starts running.static final recordAn event marking when a command is scheduled inScheduler.schedule(Command).static final recordAn event marking when a command yielded control withCoroutine.yield(). -
Method Summary
Modifier and TypeMethodDescriptionlongThe timestamp for when the event occurred.
-
Method Details
-
timestampMicros
long timestampMicros()The timestamp for when the event occurred. Measured in microseconds since some arbitrary start time.- Returns:
- The event timestamp.
- See Also:
-