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.
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.