Closed tebjan closed 4 years ago
Hi @tebjan
We don't really have a good alternative to what you have described (finding public methods with benchmark attribute etc).
We don't offer passing lambdas etc. The only thing that comes to my mind is using this method:
but it still requires you to use reflection to find the right methods and it requires a public type to be passed as well.
I am going to close this issue as this is a by-design limitation and we can't change it.
Please feel free to ask more questions and reopen the issue.
Thanks, Adam
That's very helpful. Thanks for the info, I'll try with this static Run
method and see what's possible.
Is there a guide or code example for benchmarking a method programmatically? Similar to this, but including adding some user method to test: https://github.com/dotnet/BenchmarkDotNet#simplicity
The reason I'm asking is that I'm working in a live-programming environment that doesn't have support for attributes for static compilation/reflection: https://visualprogramming.net/
So I have to set up the benchmark by code only at runtime by doing something like this: