Condividi tramite


CTimeSpan::operator +=, -=

Adds and subtracts a CTimeSpan object to and from this CTimeSpan.

CTimeSpan& operator +=(
   CTimeSpan span 
) throw( );
CTimeSpan& operator -=(
   CTimeSpan span 
) throw( );

Parameters

  • span
    The value to add to the CTimeSpan object.

Return Value

The updated CTimeSpan object.

Remarks

These operators allow you to add and subtract a CTimeSpan object to and from this CTimeSpan.

Example

CTimeSpan ts1(10); // 10 seconds
CTimeSpan ts2(100); // 100 seconds
ts2 -= ts1;
ATLASSERT(ts2.GetTotalSeconds() == 90);   

Requirements

Header: atltime.h

See Also

Concepts

CTimeSpan Class

CTimeSpan Members

Hierarchy Chart