How can I exactly construct a time stamp of actual time with milliseconds precision?
I need something like 16.4.2013 9:48:00:123. Is this possible? I have an applic
This should work:
DateTime.Now.ToString("hh.mm.ss.ffffff");
If you don't need it to be displayed and just need to know the time difference, well don't convert it to a String. Just leave it as, DateTime.Now();
And use TimeSpan to know the difference between time intervals:
Example
DateTime start;
TimeSpan time;
start = DateTime.Now;
//Do something here
time = DateTime.Now - start;
label1.Text = String.Format("{0}.{1}", time.Seconds, time.Milliseconds.ToString().PadLeft(3, '0'));