I am making an Image Steganography project for my college. I have finished the project and have kept several different algorithms for hiding data in images.
What I want
You can also use BenchmarkDotNet
Then you do:
1) Create a console project with a reference to the code you want to test.
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes;
class Program
{
static void Main()
{
var summary = BenchmarkRunner.Run();
}
}
public class YourBenchmarks
{
[Benchmark]
public object HideDataUsingAlgorithm()
{
return Namespace.hideDataUsingAlgorithm(); // call the code you want to benchmark here
}
}
2) Build in release and run without debugger.
3) Open the report that is in the bin/release/YourBenchmarks-report-stackoverflow.md
The report contains Median and StdDev by default. BenchmarkDotNet takes care of warmups and launches the process a number of times to give accurate statistics.
Sample report:
Method | Median | StdDev |
----------------------- |------------ |---------- |
HideDataUsingAlgorithm | 252.4869 ns | 8.0261 ns |
For configuration read the docs.