我正在测试基准库来衡量代码的性能。我正在阅读文档。
我无法弄清楚如何打印基准测试结果。我有一个名为"user"的类,我想对以下方法进行基准测试。
[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 的文档中,使用以下代码获取基准测试的输出。
var summary = BenchmarkRunner.Run<User>();
在Asp.net MVC应用程序中,我们应该将这段代码放在哪里才能获得基准测试结果?以下是该库的URL链接:http://benchmarkdotnet.org/GettingStarted.htm。