RTduino Source Code Reference Manual
|
Time-related functions and definitions. More...
Functions | |
void | yield (void) |
Pauses the execution of the current task, allowing other tasks to run. More... | |
void | delay (unsigned long ms) |
Delays the program for the specified number of milliseconds. More... | |
void | delayMicroseconds (unsigned int us) |
Delays the program for the specified number of microseconds. More... | |
unsigned long | millis (void) |
Returns the number of milliseconds since the Arduino board began running the current program. More... | |
unsigned long | micros (void) |
Returns the number of microseconds since the Arduino board began running the current program. More... | |
Time-related functions and definitions.
void delay | ( | unsigned long | ms | ) |
Delays the program for the specified number of milliseconds.
ms | The number of milliseconds to delay. |
void delayMicroseconds | ( | unsigned int | us | ) |
Delays the program for the specified number of microseconds.
us | The number of microseconds to delay. |
unsigned long micros | ( | void | ) |
Returns the number of microseconds since the Arduino board began running the current program.
unsigned long millis | ( | void | ) |
Returns the number of milliseconds since the Arduino board began running the current program.
void yield | ( | void | ) |
Pauses the execution of the current task, allowing other tasks to run.
The yield
function is used to pause the execution of the current task, giving the RT-Thread scheduler an opportunity to run other tasks. This function is typically used in scenarios where a task voluntarily relinquishes control to the scheduler, allowing a cooperative multitasking system.
When a task calls yield
, it enters a waiting state, and the scheduler may choose to run another task that is ready to execute. After yielding, the task that called yield
may be scheduled to run again in the future.
yield
can vary depending on the underlying RT-Thread configuration and scheduler settings.