Starts a recurring action with fixed interval If still running at next call, the action is skipped
More...
Starts a recurring action with fixed interval If still running at next call, the action is skipped
CommandMessenger.TimedAction.TimedAction |
( |
double |
interval, |
|
|
Action |
action |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
interval | The execution interval. |
action | The action to execute. |
References CommandMessenger.TimedAction.IsRunning.
59 _threadState =
new ThreadState {
IsRunning =
false};
62 _actionTimer =
new Timer(interval) {Enabled =
false, SynchronizingObject = null};
63 _actionTimer.Elapsed += OnActionTimer;
bool IsRunning
Returns whether this object is running.
Definition: TimedAction.cs:49
void CommandMessenger.TimedAction.Start |
( |
| ) |
|
|
inline |
Start timed actions.
127 _actionTimer.Enabled =
true;
void CommandMessenger.TimedAction.Stop |
( |
| ) |
|
|
inline |
Stop timed actions.
134 _actionTimer.Enabled =
false;
void CommandMessenger.TimedAction.StopAndWait |
( |
| ) |
|
|
inline |
Stop timed actions and wait until running function has finished.
141 _actionTimer.Enabled =
false;
142 while (_threadState.IsRunning)
bool CommandMessenger.TimedAction.IsRunning |
|
get |
The documentation for this class was generated from the following file:
- D:/My Documents/Github/Arduino-Code-and-Libraries/Libraries/CmdMessenger/CSharp/CommandMessenger/TimedAction.cs