INtime SDK Help
GetRtSystemTimerValues, GetRtSystemTimerValuesEx
INtime SDK v7.1 > About INtime > INtime Kernel > Time management > GetRtSystemTimerValues, GetRtSystemTimerValuesEx

Returns the current reload register value, the system hardware timer period in picosecond units (at the nominal timer input clock frequency), and an indicator to show whether a call to AdjustRtSystemTimer takes effect on the next system tick. If this bit is clear then the adjustment takes effect immediately.

BOOLEAN GetRtSystemTimerValues(
    TIMERVALUES *pTimerValues
);

typedef struct {
    DWORD _reserved;
    DWORD dwFlags;
    QWORD ReloadValue;
    QWORD ClockPeriod;
} TIMERVALUES;
#define RELOAD_COUNT_AT_NEXT_TICK 0x00000001
BOOLEAN GetRtSystemTimerValuesEx(
    TIMERVALUESEX *pTimerValues;
);

typedef struct {
    DWORD _reserved;
    DWORD dwFlags;
    QWORD ReloadValue;
    QWORD ClockPeriod;
    QWORD CurrentCount;
    QWORD TimeOffset;
    QWORD AccumulatedTicks;
    QWORD AccumulatedTime;
} TIMERVALUESEX;

Parameters

pTimerValues
A pointer to the TIMERVALUES structure to receive the values.

Fields

dwFlags
Contains information about the behavior of the timer. The bitmask value RELOAD_COUNT_AT_NEXT_TICK is set if a call to AdjustRtSystemTimer will take immediate effect or on the next system tick.
ReloadValue
The current value of the hardware timer reload timer register. The units are hardware-dependent.
ClockPeriod
The period of the system hardware timer in picoseconds. Thus the system timer period is ClockPeriod * ReloadValue, in picoseconds.
CurrentCount
The current value of the counter, which can be compared with the ReloadValue to determine how far through a cycle the timer is.
TimeOffset
The time-of-day epoch offset in microseconds.
AccumulatedTicks
The number of clock interrupts which have occurred since the kernel started, at the last time the timer was adjusted..
AccumulatedTime
The time in microseconds since the kernel was started, at the last time the timer was adjusted.

Remarks

Note that a call to GetRtSystemTimerValues that follows a call to AdjustRtSystemTimer may not return the adjusted ReloadValue until after the next system timer tick.

Return Values

TRUE
Success
FALSE
To determine the status, call GetLastRtError

Status

E_BAD_ADDR 0x800f
pTimerValues is not a valid pointer to writable memory.

Requirements

Versions Defined in Include Link to
INtime 6.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also