Edward Chuedwardchu.hashnode.dev·Jan 9, 2024C# 标准性能测试(Benchmark)本文告诉大家如何使用 benchmarkdotnet 做测试。 现在在 github 提交代码,如果有小伙伴想要知道某个函数的性能,就会用 BenchmarkDotNet 进行测试。 例如我有一个函数 StooTer ,我定义这个函数的性能是非常高,我需要告诉大家在什么的设备运行,但是因为每个人的写法不一样,所以就比较难看。而且谁也不知道你是如何测试,也许使用 StopWatch 或 DateTime 来测试。 但是在 github 经常可以看到下面的测试 BenchmarkDotNet=v0....NET develop tools.NETAdd a thoughtful commentNo comments yetBe the first to start the conversation.