TSK_settime
2-504
C Interface
Syntax
TSK_settime(task);
Parameters
TSK_Handle task;
/* task object handle */
Return Value
Void
Description
Your application can call TSK_settime before a task enters its processing
loop in order to ensure your first call to TSK_deltatime is as accurate as
possible and doesn’t reflect the time difference since the time the task
was created. However, it is only necessary to call TSK_settime once for
initialization purposes. After initialization, DSP/BIOS sets the time value
of the task’s STS object every time the task is made ready to run.
TSK statistics are handled differently than other statistics because TSK
functions typically run an infinite loop that blocks when waiting for other
threads. In contrast, HWI and SWI functions run to completion without
blocking. Because of this difference, DSP/BIOS allows programs to
identify the “beginning” of a TSK function’s processing loop by calling
TSK_settime and the “end” of the loop by calling TSK_deltatime.
For example, a loop within the task can look something like the following:
Void task
{
'do some startup work'
/* Initialize task's STS object to current
time */
TSK_settime(TSK_self
()
);
for (;;) {
/* Get data */
SIO_get(...);
'process data'
/* Get time difference and
add it to task's STS object */
TSK_deltatime(TSK_self
()
);
}
}
TSK_settime
Reset task statistics previous value to current time