I am trying to benchmark a method with parameters.
[Benchmark]
public void ViewPlan(int x)
{
//code here
}
While executing the code with [Benchmark] annotation, I got an error as "Benchmark method ViewPlan has incorrect signature. Method shouldn't have any arguments". So I tried to add [Arguments] annotation to the method as well. Refer link: https://benchmarkdotnet.org/articles/samples/IntroArguments.html
[Benchmark]
[Arguments]
public void ViewPlan(int x)
{
//code here
}
In this [Arguments] we need to specify the value of the parameter for the method as well. However, value of x is set dynamically when the functionality is called. Is there any way to pass the parameter value dynamically in [Arguments] ? Also can we benchmark static methods?If yes then how?