如何在c#.net中找到我的逻辑执行时间? [英] how to find my logic execution time in c#.net?

查看:68
本文介绍了如何在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[^]


这篇关于如何在c#.net中找到我的逻辑执行时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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