标签:
多时候需要输出程序耗时,然后记录下来,
1
2
3
4
5
6
7
8
9
10
11
|
System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); byte [] a = System.IO.File.ReadAllBytes( "x:\\新建文本文档.txt" ); textBox2.AppendText( "\r\n载入文件 总长{1} 耗时{0}秒 " .FormatWith(stopwatch.Elapsed.TotalSeconds, a.Length)); stopwatch.Reset(); stopwatch.Start(); byte [] b = LC.Fun.Hash.AES_Encrypt(a, "#JBP@Bb$DJGJ#1A!2" ); textBox2.AppendText( "\r\n加密完成 总长{1} 耗时{0}秒" .FormatWith(stopwatch.Elapsed.TotalSeconds, b.Length)); stopwatch.Reset(); stopwatch.Start(); byte [] c = LC.Fun.Hash.AES_Decrypt(b, "#JBP@Bb$DJGJ#1A!2" ); textBox2.AppendText( "\r\n解密完成 总长{1} 耗时{0}秒" .FormatWith(stopwatch.Elapsed.TotalSeconds, c.Length)); stopwatch.Stop(); |
标签:
原文地址:http://www.cnblogs.com/lxGIS/p/4350912.html