In this article, you will see a C# class which can provide exact time measurement in applications.
|
using System;
using Win32;
namespace HighPerformanceTimer
{
/// <summary>
/// Zusammendfassende Beschreibung f�r Class1.
/// </summary>
class Class1
{
/// <summary>
/// Der Haupteinstiegspunkt f�r die Anwendung.
/// </summary>
[STAThread]
static void Main(string[] args)
{
//
// TODO: F�gen Sie hier Code hinzu, um die Anwendung zu starten
//
HiPerfTimer pt = new HiPerfTimer(); // create a new PerfTimer object
pt.Start(); // start the timer
Console.WriteLine("Test\n"); // the code to be timed
pt.Stop(); // stop the timer
Console.WriteLine("Duration: {0} sec\n", pt.Duration); // print the duration of the timed code
Console.ReadLine();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.