This class defines an arbitrary time interval to millisecond accuracy.
![]() | Construction |
![]() | Overrides from class PObject |
![]() | Access functions |
![]() | Operations |
![]() | Comparison functions |
![]() | milliseconds Number of milliseconds in time interval. |
Run Time Type functions
I/O functions
Miscellaneous functions
This class defines an arbitrary time interval to millisecond accuracy. The interval can be both positive and negative.A long int is used to store the time interval so it is limited to LONG_MAX (found in the standard C header file limits.h) milliseconds. This is approximately 596 hours for 32 bit integers.
There is a constant, PMaxTimeInterval which defines the maximum number of milliseconds that a time interval may be.
PTimeInterval(120000) PTimeInterval(60000, 60) PTimeInterval(60000, 0, 1) PTimeInterval(0, 60, 1) PTimeInterval(0, 0, 2)
virtual Comparison Compare( const PObject & obj ) const
virtual void PrintOn( ostream & strm ) const
virtual void ReadFrom( istream & strm )
long GetSeconds() const
long GetMinutes() const
int GetHours() const
int GetDays() const
DWORD GetInterval() const
void SetInterval( PInt64 milliseconds = 0, long seconds = 0, long minutes = 0, long hours = 0, int days = 0 )
SetInterval(120000)
SetInterval(60000, 60)
SetInterval(60000, 0, 1)
SetInterval(0, 60, 1)
SetInterval(0, 0, 2)
seconds - Number of seconds for interval.
minutes - Number of minutes for interval.
hours - Number of hours for interval.
days - Number of days for interval.
PTimeInterval operator+( const PTimeInterval & interval ) const
PTimeInterval& operator+=( const PTimeInterval & interval )
PTimeInterval operator-( const PTimeInterval & interval ) const
PTimeInterval& operator-=( const PTimeInterval & interval )
PTimeInterval operator*( int factor ) const
PTimeInterval& operator*=( int factor )
PTimeInterval operator/( int factor ) const
PTimeInterval& operator/=( int factor )
BOOL operator!=( const PTimeInterval & interval ) const
BOOL operator> ( const PTimeInterval & interval ) const
BOOL operator>=( const PTimeInterval & interval ) const
BOOL operator< ( const PTimeInterval & interval ) const
BOOL operator<=( const PTimeInterval & interval ) const
Alphabetic index HTML hierarchy of classes or Java