Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
1. How To: Measure execution time in C#
Updated: 9 Mar 2011
Please try this method to get execution time. I'm not sure that it is very accurate.public static TimeSpan GetDuration(Stopwatch sw, ThreadStart method){ sw.Reset(); sw.Start(); method(); sw.Stop(); return sw.Elapsed;}you can put it into any common static class and use as...
C#, Visual-Studio, time, NET, execution
|
|
|
|
2. How To: Measure execution time in C#
Updated: 26 Feb 2011
Here is a useful generic class you can directly use in your project.public class Timer{ public static readonly bool IsHighPerformance; [DllImport("Kernel32.dll")] private static extern bool QueryPerformanceCounter(out long lpPerformanceCount); //Retrieves the current...
C#, Visual-Studio, time, NET, execution
|
|
|
|
My name is Robert Kanasz and I have been working with ASP.NET, WinForms and C# for several years.
MCTS - .NET Framework 3.5, ASP.NET Applications
- SQL Server 2008, Database Development
- SQL Server 2008, Implementation and Maintenance
- .NET Framework 4, Data Access
- .NET Framework 4, Service Communication Applications
- .NET Framework 4, Web Applications
MCPD - ASP.NET Developer 3.5
- Web Developer 4
MCITP - Database Administrator 2008
- Database Developer 2008
Open source projects:
DBScripter - Library for scripting SQL Server database objects
Please, do not forget vote