VxWorks Reference Manual : Libraries
tickLib - clock tick support library
tickAnnounce( ) - announce a clock tick to the kernel
tickSet( ) - set the value of the kernel's tick counter
tickGet( ) - get the value of the kernel's tick counter
This library is the interface to the VxWorks kernel routines that announce a clock tick to the kernel, get the current time in ticks, and set the current time in ticks.
Kernel facilities that rely on clock ticks include taskDelay( ), wdStart( ), kernelTimeslice( ), and semaphore timeouts. In each case, the specified timeout is relative to the current time, also referred to as "time to fire." Relative timeouts are not affected by calls to tickSet( ), which only changes absolute time. The routines tickSet( ) and tickGet( ) keep track of absolute time in isolation from the rest of the kernel.
Time-of-day clocks or other auxiliary time bases are preferable for lengthy timeouts of days or more. The accuracy of such time bases is greater, and some external time bases even calibrate themselves periodically.
tickLib.h
tickLib, kernelLib, taskLib, semLib, wdLib, VxWorks Programmer's Guide: Basic OS
tickAnnounce( ) - announce a clock tick to the kernel
void tickAnnounce (void)
This routine informs the kernel of the passing of time. It should be called from an interrupt service routine that is connected to the system clock. The most common frequencies are 60Hz or 100Hz. Frequencies in excess of 600Hz are an inefficient use of processor power because the system will spend most of its time advancing the clock. By default, this routine is called by usrClock( ) in usrConfig.c.
N/A
tickLib, kernelLib, taskLib, semLib, wdLib, VxWorks Programmer's Guide: Basic OS
tickSet( ) - set the value of the kernel's tick counter
void tickSet ( ULONG ticks /* new time in ticks */ )
This routine sets the internal tick counter to a specified value in ticks. The new count will be reflected by tickGet( ), but will not change any delay fields or timeouts selected for any tasks. For example, if a task is delayed for ten ticks, and this routine is called to advance time, the delayed task will still be delayed until ten tickAnnounce( ) calls have been made.
N/A
tickLib, tickGet( ), tickAnnounce( )
tickGet( ) - get the value of the kernel's tick counter
ULONG tickGet (void)
This routine returns the current value of the tick counter. This value is set to zero at startup, incremented by tickAnnounce( ), and can be changed using tickSet( ).
The most recent tickSet( ) value, plus all tickAnnounce( ) calls since.
tickLib, tickSet( ), tickAnnounce( )