osCreateTimer function
Declaration:
HANDLE osCreateTimer(
  SYSNAME Name,
  BOOL ManualReset
);
Parameters:
Name

Name of the object (may be NULL).

ManualReset

When it is set to TRUE, created is a manual-reset timer, otherwise an auto-reset timer (see below to the description section for more information).

Return value:

The return value is a handle to the created timer object when success or NULL_HANDLE on failure. Use osGetLastError function to obtain extended error information.

Description:

Function creates a timer object.

Timer objects provide methods for synchronization of tasks in reference to the specific time points or time intervals. Timers are similar to events. They are set into signaled state every time when a specified amount of time elapses and into non-signaled when timers are reset.

During timer creation, an optional timer name may be specified. It makes tasks able to open it by osOpenTimer function. The non-used timer should be closed with the osCloseHandle. Timer will be deleted when it is closed by all tasks that opened it. More information you can find in the system objects managementsection.

If all of the osOpen* functions are not used, the system ignores an object name and the code used to name management will be removed. It will reduce final size of the output code. For more information about the names and object opening see the system objects managementsection.

When the ManualReset is set to TRUE, the timer is a manual-reset timer. Otherwise it is an auto-reset timer. In case of manual-reset timer the new cycle can be started with osResetTimer, and in case of auto-reset timer the new cycle is also started just after the end of the previous one. When many tasks are waiting for auto-reset timer, only one will start after the end of each cycle.

For more information on timers, please refer to the timer objectssection.

Function is available only, when the value of OS_USE_TIMER constant is set to 1.

SpaceShadow documentation