You write a value to a counter by incrementing the counter’s current raw value by a positive or negative number. You do this using the IncrementBy method on the PerformanceCounter class.
Note Incrementing by a negative number decrements the counter by the absolute value of the number. For example, incrementing with a value of 3 will increase the counter’s raw value by three. Incrementing with a value of –3 will decrease the counter’s raw value by three.
To write values to performance counters
– or –
The IncrementBy method returns the new value of the counter.