|
ProcessHelperGetProcessTimes Method |
Namespace: Xcalibur.NativeMethods.V2.ProcessesAssembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax [DllImportAttribute("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static bool GetProcessTimes(
IntPtr handle,
out long creation,
out long exit,
out long kernel,
out long user
)
<DllImportAttribute("kernel32.dll", CharSet := CharSet.Auto, SetLastError := true>]
Public Shared Function GetProcessTimes (
handle As IntPtr,
<OutAttribute> ByRef creation As Long,
<OutAttribute> ByRef exit As Long,
<OutAttribute> ByRef kernel As Long,
<OutAttribute> ByRef user As Long
) As Boolean
public:
[DllImportAttribute(L"kernel32.dll", CharSet = CharSet::Auto, SetLastError = true)]
static bool GetProcessTimes(
IntPtr handle,
[OutAttribute] long long% creation,
[OutAttribute] long long% exit,
[OutAttribute] long long% kernel,
[OutAttribute] long long% user
)
[<DllImportAttribute("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)>]
static member GetProcessTimes :
handle : IntPtr *
creation : int64 byref *
exit : int64 byref *
kernel : int64 byref *
user : int64 byref -> bool
Parameters
- handle IntPtr
- A handle to the process whose timing information is sought. The handle
must have the or
access right.
- creation Int64
- A pointer to a FILETIME structure that receives the creation time
of the process.
- exit Int64
- A pointer to a FILETIME structure that receives the exit time of the
process. If the process has not exited, the content of this structure is undefined.
- kernel Int64
- A pointer to a FILETIME structure that receives the amount of time
that the process has executed in kernel mode. The time that each of the threads of the
process has executed in kernel mode is determined, and then all of those times are summed
together to obtain this value.
- user Int64
- A pointer to a FILETIME structure that receives the amount of time that
the process has executed in user mode. The time that each of the threads of the process has
executed in user mode is determined, and then all of those times are summed together to
obtain this value. Note that this value can exceed the amount of real time elapsed (between
creation and exit) if the process executes across multiple CPU cores.
Return Value
BooleanIf the function fails, the return value is zero. To get extended error
information, call .
See Also