This is a migrated thread and some comments may be shown as answers.

Bug: PerformanceCounter.NextValue() decompiled incorrectly

1 Answer 9 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Karol
Top achievements
Rank 1
Karol asked on 14 Jun 2016, 04:24 PM

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 :-)

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 15 Jun 2016, 05:29 PM
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 :)

Regards,
Alexander
Telerik
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
Tags
General Discussions
Asked by
Karol
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or