RtGetThreadTimes

The RtGetThreadTimes function retrieves timing information for the specified RTSS thread. This function can only be called in RTSS processes.

Syntax

BOOL RtGetThreadTimes(
    HANDLE hThread,
    LPFILETIME lpCreationTime,
    LPFILETIME lpExitTime,
    LPFILETIME lpExecuteTime
);

Parameters

hThread

Handle to the RTSS thread whose timing information is sought.

lpCreationTime

Pointer to a FILETIME structure that receives the creation time of the thread.

lpExitTime

Pointer to a FILETIME structure that receives the exit time of the thread. If the thread has not exited, the content of this structure is undefined.

lpExecuteTime

Pointer to a FILETIME structure that receives the total amount of time that the thread has executed since it is created.

Return Value

A non-zero value if the function succeeds, 0 (zero) if the function fails

To get extended error information, call GetLastError.

Remarks

All times are expressed using FILETIME data structures. Such a structure contains two 32-bit values that combine to form a 64-bit count of 100-nanosecond units.

Thread creation and exit times are points in time expressed as the amount of time that has elapsed since midnight on January 1, 1601 at Greenwich, England. There are several functions that an application can use to convert such values to more generally useful forms; see Clock and Timer APIs.

You can get thread exit time by calling this function after a TerminateThread call, but before a CloseHandle call for the thread handle.

Thread execute time is an amount of time that the thread has run. For example, if a thread has executed one second since created, this function will fill the FILETIME structure specified by lpExecuteTime with a 64-bit value of ten million. That is the number of 100-nanosecond units in one second. Thread execute time gets updated at each RTX HAL Timer period.

Requirements

Minimum Supported Version RTX64 2013
Header RtssApi.h
Library Rtx_Rtss.lib