Export (0) Print
Expand All

ProcessThread.PrivilegedProcessorTime Property

Gets the amount of time that the thread has spent running code inside the operating system core.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)

public TimeSpan PrivilegedProcessorTime { get; }

Property Value

Type: System.TimeSpan
A TimeSpan indicating the amount of time that the thread has spent running code inside the operating system core.

ExceptionCondition
Win32Exception

The thread time could not be retrieved.

PlatformNotSupportedException

The platform is Windows 98 or Windows Millennium Edition.

NotSupportedException

The process is on a remote computer.

Windows uses several different protection mechanisms, and at the root of them all is the distinction between user mode and privileged mode. PrivilegedProcessorTime corresponds to the amount of time that the application has spent running in privileged mode, inside the operating system core. The UserProcessorTime property indicates the amount of time that the application has spent running code in user mode, outside the system core.

User mode restricts the application in two important ways. First, the application cannot directly access the peripherals, but instead must call the operating system core to get or set peripheral data. The operating system can thus ensure that one application does not destroy peripheral data that is needed by another. Second, the application cannot read or change data that the operating system itself maintains. This restriction prevents applications from either inadvertently or intentionally corrupting the core. If the application needs the operating system to perform an operation, it calls one of the system's routines. Many of these transition into privileged mode, perform the operation, and smoothly return to user mode.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft