Bug: PerformanceCounter.NextValue() decompiled incorrectly

2 posts, 0 answers
  1. Karol
    Karol avatar
    1 posts
    Member since:
    Jun 2016

    Posted 14 Jun 2016 Link to this post

    Look how JustDecomplile decompiles System.Diagnostics.PerformanceCounter.NextValue():

            public float NextValue()
                CounterSample counterSample = this.NextSample();
                this.oldSample = counterSample;
                return CounterSample.Calculate(this.oldSample, counterSample);

    If that was really the way the code is written, the method would always return 0

    ILSpy gets it right:

    public float NextValue()
        CounterSample nextCounterSample = this.NextSample();
        float arg_1A_0 = CounterSample.Calculate(this.oldSample, nextCounterSample);
        this.oldSample = nextCounterSample;
        return arg_1A_0;

    Hope this helps--please fix :-)

  2. Alexander
    Alexander avatar
    336 posts

    Posted 15 Jun 2016 Link to this post

    Hello Karol,

    Thank you for letting us know about this problem. We have added it to our list and it will be fixed, based on its backlog priority, so please, update regularly.

    We wanted to show you how much we appreciate your help, so we've added some bonus Telerik points to your account.

    Thank you again :)

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top