.NET Framework Class Library  

PerformanceCounter.NextValue Method

Obtains a counter sample and returns the calculated value for it.

[Visual Basic]
Public Function NextValue() As Single
[C#]
public float NextValue();
[C++]
public: float NextValue();
[JScript]
public function NextValue() : float;

Return Value

The next calculated value that the system obtains for this counter.

Exceptions

Exception Type Condition
InvalidOperationException The instance is not correctly associated with a performance counter.
Win32Exception An error occurred when accessing a system API.

Remarks

Note   If the calculated value of a counter depends on two counter reads, the first read returns 0.0.

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