INtime SDK Help
GetRtThreadAccounting
INtime SDK v7.1 > About INtime > INtime Kernel > Threads > GetRtThreadAccounting

Returns information about when a thread was created and the amount of time the thread has run.

Although the time since the last call to GetRtThreadAccounting is stored internally as a 64-bit value, it is returned in the call only as a 32-bit quantity. Therefore, you must either call often enough to avoid overrunning the TotalTicksSinceCallLo and RunningTicksSinceCallLo fields (which are only the lower 32 bits) or use the TotalRunningTicksLo or TotalRunningTicksHi fields to derive the appropriate information.

BOOLEAN GetRtThreadAccounting(
    RTHANDLE hThread,             // handle for thread
    LPTHREADACCOUNTING lpInfo,    // pointer to THREADACCOUNTING structure
    DWORD dwFlags                 // flags
);

Parameters

hThread
A handle for a RT thread from which to return the accounting information.
lpInfo
A pointer to the THREADACCOUNTING structure which stores accounting information.
dwFlags
Specify one of these values:
0 (Default) Accumulates information from call to call.
RESET_ACCOUNTING Resets the total_ticks_since_call_lo and running_ticks_since_call_lo fields after this call.

Remarks

Although the time since the last call to GetRtThreadAccounting is stored internally as a 64-bit value, it is returned in the call only as a 32-bit quantity. Therefore, you must either call often enough to avoid overrunning the TotalTicksSinceCallLo and RunningTicksSinceCallLo fields (which are only the lower 32 bits) or use the TotalRunningTicksLo or TotalRunningTicksHi fields to derive the appropriate information.

Return Values

TRUE
Success.
FALSE
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_BAD_ADDR 0x800F
lpInfo does not refer to a writeable area of sufficient size to receive the data.

Requirements

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

Structures