This documentation is archived and is not being maintained.

PerformanceCounter.Decrement Method

Decrements the associated performance counter by one through an efficient atomic operation.

[Visual Basic]
Public Function Decrement() As Long
public long Decrement();
public: __int64 Decrement();
public function Decrement() : long;

Return Value

The decremented counter value.


Exception Type Condition
InvalidOperationException The counter is read-only, so the application cannot decrement it.


The instance is not correctly associated with a performance counter.

Win32Exception An error occurred when accessing a system API.


You can write only to custom counters. All system counters are read-only.


Platforms: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

PerformanceCounter Class | PerformanceCounter Members | System.Diagnostics Namespace