C#中如何毫秒级确定程序应用时间?
2014-04-21 19:06
357 查看
using System; using System.Diagnostics; using System.Threading; class Program { static void Main(string[] args) { Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); Thread.Sleep(10000); stopWatch.Stop(); // Get the elapsed time as a TimeSpan value. TimeSpan ts = stopWatch.Elapsed; // Format and display the TimeSpan value. string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); Console.WriteLine("RunTime " + elapsedTime); } }
相关文章推荐
- C#如何为winform程序打包发布应用(图解)
- C#如何为winform程序打包发布应用(图解)
- C#如何为winform程序打包发布应用(图解)(转载)
- C#如何为winform程序打包发布应用(图解)
- C#如何为winform程序打包发布应用(图解)
- C#如何为winform程序打包发布应用(图解教程)
- C#如何为winform程序打包发布应用(图解教程)
- 图解C#如何为winform程序打包发布应用
- C#如何为winform程序打包发布应用(图解教程)
- C#如何为winform程序打包发布应用(图解教程)
- 如何构造一个C#语言的爬虫程序开发者在线 Builder.com.cn 更新时间:2008-07-20作者: 来源:
- 图解C#如何为winform程序打包发布应用
- C#如何为winform程序打包发布应用(图解)
- C#如何为winform程序打包发布应用(图解)
- 如何在Visual Studio 2017中使用C# 7+语法 构建NetCore应用框架之实战篇(二):BitAdminCore框架定位及架构 构建NetCore应用框架之实战篇系列 构建NetCore应用框架之实战篇(一):什么是框架,如何设计一个框架 NetCore入门篇:(十二)在IIS中部署Net Core程序
- C#如何为winform程序打包发布应用(图解教程)
- 如何在C#中测试程序运行的时间
- 图解C#如何为winform程序打包发布应用
- C#如何为winform程序打包发布应用(图解)
- VBscript(ASP)计算程序运行时间,精度到毫秒