30 #ifndef PTLIB_TIMEINTERVAL_H
31 #define PTLIB_TIMEINTERVAL_H
291 PInt64 milliseconds = 0,
498 #include "msos/ptlib/timeint.h"
500 #include "unix/ptlib/timeint.h"
545 #endif // PTLIB_TIMEINTERVAL_H
PFrequencyTime(double frequency)
Definition: timeint.h:523
double GetSecondsAsDouble() const
Get the number of seconds, and partial seconds, as floating point, for the time interval.
#define PMaxTimeInterval
Definition: timeint.h:31
Output as "hh:mm:ss.uuu".
Definition: timeint.h:154
Class wrapper of PTimeInterval to initialise to a frequency.
Definition: timeint.h:521
void SetMilliSeconds(PInt64 msecs)
Set the number of milliseconds for the time interval.
PTimeInterval operator-() const
Unary minus, get negative of time interval.
virtual void InternalSet(int64_t t)
static int64_t const MilliToNano
Definition: timeint.h:482
Ouptut using SI units, ns, us, ms, s, though not ks, Ms etc.
Definition: timeint.h:157
PTimeInterval operator+(const PTimeInterval &interval) const
Add the two time intervals yielding a third time interval.
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:51
static int64_t const SecsToNano
Definition: timeint.h:483
static PTimeInterval quiet_NaN()
Definition: timeint.h:539
PTimeInterval operator*(int factor) const
Multiply the time interval by a factor yielding a third time interval.
virtual void ReadFrom(istream &strm)
Input the time interval from the I/O stream.
PInt64 GetMicroSeconds() const
Get the number of microseconds for the time interval.
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:2251
static PTimeInterval denorm_min()
Definition: timeint.h:537
static int64_t const MicroToNano
Definition: timeint.h:481
int IntervalType
Definition: timeint.h:265
bool operator<=(const PTimeInterval &interval) const
Compare to the two time intervals.
PInt64 GetNanoSeconds() const
Get the number of nanoseconds for the time interval.
virtual Comparison Compare(const PObject &obj) const
Rank the two time intervals.
PTimeInterval & operator-=(const PTimeInterval &interval)
Subtract the second time interval from the first time interval.
bool operator!=(const PTimeInterval &interval) const
Compare to the two time intervals.
Formats
Definition: timeint.h:153
void SetFrequency(double frequency)
Set time interval from a frequency.
Class wrapper of PTimeInterval to initialise to microseconds.
Definition: timeint.h:512
IntervalType GetInterval() const
Get the "clamped" number of milliseconds for the time interval.
bool operator==(const PTimeInterval &interval) const
Compare to the two time intervals.
double GetFrequency() const
Get time interval as a frequency.
static PTimeInterval round_error()
Definition: timeint.h:536
PTimeInterval(PInt64 millisecs=0)
Create a new time interval object.
static PTimeInterval signaling_NaN()
Definition: timeint.h:540
void SetMicroSeconds(int64_t usecs, int secs=0)
Set the number of microseconds for the time interval.
PTimeInterval & operator/=(int factor)
Divide the time interval by a factor.
static PTimeInterval Frequency(double frequency)
Return a PTimeInterval from a frequency.
PTimeInterval & operator=(const PTimeInterval &other)
static PTimeInterval min()
Definition: timeint.h:533
static PTimeInterval Seconds(double secs)
Return a PTimeInterval in seconds.
void SetInterval(PInt64 milliseconds=0, long seconds=0, long minutes=0, long hours=0, int days=0)
Set the value of the time interval.
Class wrapper of PTimeInterval to initialise to nanoseconds.
Definition: timeint.h:506
PTimeInterval PMilliSeconds
As we have PNanoSeconds & PMicroSeconds, this is for completeness.
Definition: timeint.h:518
PTimeInterval & operator+=(const PTimeInterval &interval)
Add the second time interval to the first time interval.
The character string class.
Definition: pstring.h:108
void SetSeconds(double secs)
Set the number of seconds for the time interval.
static int64_t const DaysToNano
Definition: timeint.h:486
PMicroSeconds(int64_t microseconds)
Definition: timeint.h:514
Output as "s.uuu".
Definition: timeint.h:156
virtual void PrintOn(ostream &strm) const
Output the time interval to the I/O stream.
static PTimeInterval max()
Definition: timeint.h:534
PNanoSeconds(int64_t nanoseconds)
Definition: timeint.h:508
static int64_t const HoursToNano
Definition: timeint.h:485
static PTimeInterval epsilon()
Definition: timeint.h:535
bool operator>(const PTimeInterval &interval) const
Compare to the two time intervals.
Output as "d:hh:mm:ss.uuu".
Definition: timeint.h:155
virtual int64_t InternalGet() const
long GetMinutes() const
Get the number of whole minutes for the time interval.
bool operator>=(const PTimeInterval &interval) const
Compare to the two time intervals.
static PTimeInterval NanoSeconds(int64_t nsecs, int secs=0)
Return a PTimeInterval in nanoseconds.
void SetNanoSeconds(int64_t nsecs, int secs=0)
Set the number of nanoseconds for the time interval.
long GetSeconds() const
Get the number of whole seconds for the time interval.
bool operator<(const PTimeInterval &interval) const
Compare to the two time intervals.
int operator/(const PTimeInterval &smaller) const
Divide the time interval by another interval yielding a count.
int GetDays() const
Get the number of whole days for the time interval.
PInt64 GetMilliSeconds() const
Get the number of milliseconds for the time interval.
int GetHours() const
Get the number of whole hours for the time interval.
PObject * Clone() const
Create a new copy of the time interval.
PTimeInterval & operator*=(int factor)
Multiply the time interval by a factor.
Ultimate parent class for all objects in the class library.
Definition: object.h:2204
static PTimeInterval MicroSeconds(int64_t usecs, int secs=0)
Return a PTimeInterval in microseconds.
static PTimeInterval infinity()
Definition: timeint.h:538
PString AsString(int decimals=3, Formats format=NormalFormat, int width=1) const
Output the time interval as a string.
static int64_t const MinsToNano
Definition: timeint.h:484