TimeSpan problem.

  • Thread starter Thread starter Eduardo S.E. de Castro
  • Start date Start date
E

Eduardo S.E. de Castro

Hi,
I'm created a class that has a counter to calculate the elapsed time
since its creation.
The problem is that after 50 seconds, the timespan show negative values!
I don't understand why.

public class Example
{
//Start time
private DateTime m_dtimeStart = DateTime.Now;

public string CountTime()
{
TimeSpan tspanResult = DateTime.Now.Subtract(this.m_dtimeStart);
string strTime = tspanResult.ToString();

return strTime;
}


Thank You.
 
Thank you.
It's a emulator problem.

Stopwatch is very usefull too.

Eduardo
 
Back
Top