运行基准库以获得结果。 [英] Running benchmark library to get results.

查看:103
本文介绍了运行基准库以获得结果。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试基准库来衡量代码的性能。我正在阅读文档。



我无法弄清楚如何打印结果。



我尝试了什么:



我正在尝试对用户类中的这种方法进行基准测试



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!");
        }





在benchmarkdot net的文档中,写道为了得到结果你需要把它放到码。





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>();





我们在哪里可以使用此代码来获取MVC应用程序的结果。



这里是库的URL

使用入门 - BenchmarkDotNet文档 [ ^ ]

推荐答案

您的问题是由此声明推断的我无法弄清楚如何打印结果。



这个问题的答案可以在这里的文档中找到:步骤4.查看结果 [ ^ ]
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[^]


这篇关于运行基准库以获得结果。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆