Closed ooosan closed 1 month ago
You can use [InvocationCount(...)]
to control how many times the method will be invoked per iteration.
I tried your code with and without the Console.Writeline
, and it worked for me.
The provided benchmark is also wrong, please consider reading https://github.com/dotnet/performance/blob/main/docs/microbenchmark-design-guidelines.md
This is my code:
the final printed result shows that it exceeds five hundred thousand. If I don't write "Console.WriteLine("sub:" + fParaIntSub);", the program won't be able to run. What could be the reason for this?