Stopwatch, . : , . ( Stopwatch, , .) , IO- , ( ) . , , ..
, , , , . , 5 ... .
- :
[DllImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetProcessTimes(IntPtr hProcess,
out FILETIME lpCreationTime,
out FILETIME lpExitTime,
out ulong lpKernelTime,
out ulong lpUserTime);
static ulong GetTime(Process process)
{
FILETIME lpCreationTime, lpExitTime;
ulong lpKernelTime, lpUserTime;
GetProcessTimes(process.Handle, out lpCreationTime,
out lpExitTime, out lpKernelTime, out lpUserTime);
return lpKernelTime + lpUserTime;
}