RtGetThreadTimes

The RtGetThreadTimes function retrieves timing information for the specified Process thread.

Syntax

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

Parameters

hThread

A handle to a process' thread to retrieve timing information for.

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

If the function succeeds, it returns a non-zero value. If the function fails, it returns 0 (zero) .

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 time 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.

Thread execute time is an amount of time that the thread has run. For example, if a thread executes one second after it's 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 eRTOS HAL Timer period.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

RtssApi.h rtkrnl.lib