This page is available in: en

3.2.8 Relative Time and System Time

When the time of an event occurrence is specified relative to another time, such as the time when a system call was invoked, relative time (RELTIM type) is used. If relative time is used to specify event occurrence time, it is necessary to guarantee that the event processing will take place after the specified time has elapsed from the time base. Relative time (RELTIM type) is also used for e.g. event occurrence. In such cases the method of interpreting the specified relative time is determined for each case.

When time is specified as an absolute value, system time (SYSTIM type) is used. The T-Kernel speci.cation provides a function for setting system time, but even if the system time is changed using this function, there is no change in the real world time (actual time) at which an event occurred that was specified using relative time. What changes is the system time at which an event occurred that was specified as relative time.

  • SYSTIM: System time Time base 1 millisecond, 64-bit signed integer

		typedef struct systim {
		W hi; /* high 32 bits */
		UW lo; /* low 32 bits */
	} SYSTIM;
  • RELTIM: Relative time Time base 1 millisecond, 32-bit or higher unsigned integer (UINT)

		typedef UINT RELTIM;
  • TMO: Timeout time Time base 1 millisecond, 32-bit or higher signed integer (INT)

		typedef INT TMO;

Endless wait can be specified as TMO_FEVR =(.1).

Additional Note

Timeout or other such processing must be guaranteed to occur after the time specified as RELTIM or TMO has elapsed. For example, if the timer interrupt cycle is 1 ms and a timeout of 1 ms is specified, timeout occurs on the second timer interrupt. (The .rst timer interrupt does not exceed 1 ms.)

Comments