标签:style blog color io os ar 使用 for strong
很多时候需要输出程序耗时,然后记录下来,
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();
标签:style blog color io os ar 使用 for strong
原文地址:http://www.cnblogs.com/chengulv/p/4034206.html