Decrement Method

PerformanceCounter.Decrement Method

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

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

Return Value

The decremented counter value.

Exceptions

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

-or-

The instance is not correctly associated with a performance counter.

Win32Exception An error occurred when accessing a system API.

Remarks

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

Requirements

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

Show:
© 2016 Microsoft