I am searching how to format time including microseconds. I\'m using class DateTime, it allowes (using properties) to get data till miliseconds, which is not enougth. I trie
I was unable to get Johns tick to micorosecond conversion to work. Here is how I was able to measure Microsecond and Nanosecond resolution by using ticks and the Stopwatch:
Stopwatch sw = new Stopwatch();
sw.Start();
// Do something you want to time
sw.Stop();
long microseconds = sw.ElapsedTicks / (Stopwatch.Frequency / (1000L*1000L));
long nanoseconds = sw.ElapsedTicks / (Stopwatch.Frequency / (1000L*1000L*1000L));
Console.WriteLine("Operation completed in: " + microseconds + " (us)");
Console.WriteLine("Operation completed in: " + nanoseconds + " (ns)");