TimeSpan problem.

  • Thread starter Eduardo S.E. de Castro
  • 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.
 
E

Eduardo S.E. de Castro

Thank you.
It's a emulator problem.

Stopwatch is very usefull too.

Eduardo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top