4

I am testing benchmark library to measure the performance of the code. I am reading up the documentation.

I am not able to figure out how to print out results of benchmarks. I have a class called user and i want to bechmark the following method.

[Benchmark]
public bool FollowerAdded(User newFollower)
{
    // code for notifying user that they have an added follower
    Notification notification = new Notification();
    return notification.NotifyUser(this, newFollower.UserName + " is now following you!");
}

In the documentation of benchmarkdot net, Use the following code to get printout of bechmarks.

var summary = BenchmarkRunner.Run<User>();

Where can we put this code to get the results in case of Asp.net MVC application to get the benchmarking results?

here is the URL of the library http://benchmarkdotnet.org/GettingStarted.htm

1 Answer 1

1

A bit late but here it goes,

Probably you need a console application project to reference your library and run the benchmark, after running it the results will be printed on the console and the reports will be located in

summary.ResultsDirectoryPath

typically

$(TargetDir)BenchmarkDotNet.Artifacts\results\
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.