如何在c#.net中找到我的逻辑执行时间?
问题描述:
如何在c#.net中找到我的逻辑执行时间?
how to find my logic execution time in c#.net?
答
嗨
您将必须使用计时器,在逻辑之前启动它,在逻辑之后停止它. .NET具有内置计时器.
Jacques
Hi
You will have to use the timer, Start it before the logic and stop it after the logic. .NET has an inbuilt timer.
Jacques
查看 Stopwatch类 [^ ]-它易于使用并提供准确的时间安排.
本技巧说明了如何使用它来衡量对字符串中的行进行计数的各种不同方式的执行时间: ^ ]
Look at the Stopwatch class[^] - it''s easy to use and provides accurate timing.
This Tip shows it in use to measure the execution time of various different ways of counting lines in a string: Counting lines in a string[^]