hi,
I guess, for performance testing you need the milliseconds value right?
you can use like below,
int result = Environment.TickCount & Int32.MaxValue;
transferLogger.Debug("BaseTransferPresneter Start Time:" + System.DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss") + "Tick count : " + result);
//Your code to test performance
transferLogger.Debug("BaseTransferPresneter End Time:" + System.DateTime.Now.ToString("dd-MM-yyyy hh:mm:ss") + "Tick count : " + Environment.TickCount & Int32.MaxValue - result);
Environment.TickCount :Gets the number of milliseconds elapsed since the system started [from Msdn].
So just subtract he previous time from the current time will give you the total milli seconds elapsed.... (you dont need to calculate from the Datatime value)
Regards
Deepu
Regards
Deepu