c# asp.net 测试程序执行时间
using System.Diagnostics; System.Diagnostics.Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); // 开始监视代码运行时间 //要测试的代码写这里 stopwatch.Stop(); // 停止监视 TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间 double hours = timespan.TotalHours; // 总小时数 double minutes = timespan.TotalMinutes; // 总分钟数 double seconds = timespan.TotalSeconds; // 总秒数 double milliseconds = timespan.TotalMilliseconds; // 总毫秒数
结果如果不能弹出提示框,可以打印到log日志里
相关推荐
HappinessCat 2020-06-10
jeason 2020-06-09
lucialee 2020-06-09
测试自动化顾问 2020-06-09
deadgrape 2020-06-09
Henryztong 2020-06-09
追迷梦境 2020-06-07
Testingba工作室 2020-06-07
deadgrape 2020-05-16
ITstudied 2020-05-01
RocketJ 2020-02-21
abdstime 2020-02-19
RocketJ 2020-02-18
chichichi0 2020-02-14
lucialee 2020-02-12
woxxoole 2020-02-11
Dipa 2020-01-25
Henryztong 2020-01-19