Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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 get print out the results.

What I have tried:

I am trying to benchmark this method which is in User Class

[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, It is written that In order to get the results you need to put this code.

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


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

here is the URL of the library
Getting Started - BenchmarkDotNet Documentation[^]
Posted
Updated 28-Feb-17 15:28pm

1 solution

your question was inferred by this statement "I am not able to figure out how to get print out the results."

The answer to this question is found in the documentation here: Step 4. View Results[^]
 
Share this answer
 
v2
Comments
codegeekalpha 28-Feb-17 21:32pm    
can you explain what you are trying to say.. you just reference a link showing the results.
codegeekalpha 28-Feb-17 21:34pm    
my question is how to run bechmark in mvc application.. where to put this line var summary = BenchmarkRunner.Run<user>(); .. In console application it goes in main
Graeme_Grant 28-Feb-17 21:46pm    
your question was inferred by this statement "I am not able to figure out how to get print out the results." The point in the documentation answered this question.

I am not familiar with the library, so I can't give you an exact answer to your new question. It depends on what you are trying to benchmark. If I had to guess, it would be server side code. Benchmarking usually has a start point and a stop point. The documentation will walk you through how to set it up.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900