System.Diagnostics.PerformanceCounter.NextValue C# (CSharp) Method

NextValue() public method

public NextValue ( ) : float
return float
        public float NextValue() { throw null; }
        public void RemoveInstance() { }

Usage Example

Esempio n. 1
1
        public static String GetCounterValue(PerformanceCounter pPerformanceCounter)
        {
            String retval = "";

            // Retrieve PerformanceCounter result based on its CounterType.
            switch (pPerformanceCounter.CounterType)
            {
                case PerformanceCounterType.NumberOfItems32:
                    retval = pPerformanceCounter.RawValue.ToString();
                    break;

                case PerformanceCounterType.NumberOfItems64:
                    retval = pPerformanceCounter.RawValue.ToString();
                    break;

                case PerformanceCounterType.RateOfCountsPerSecond32:
                    retval = pPerformanceCounter.NextValue().ToString();
                    break;

                case PerformanceCounterType.RateOfCountsPerSecond64:
                    retval = pPerformanceCounter.NextValue().ToString();
                    break;

                case PerformanceCounterType.AverageTimer32:
                    retval = pPerformanceCounter.NextValue().ToString();
                    break;

                default:
                    retval = null;
                    break;
            }

            return retval;
        }
All Usage Examples Of System.Diagnostics.PerformanceCounter::NextValue