Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

void PTimeInterval::SetInterval ( PInt64  milliseconds = 0,
long  seconds = 0,
long  minutes = 0,
long  hours = 0,
int  days = 0 
) [virtual]

Set the value of the time interval. The time interval, in milliseconds, is the sum of all of the parameters. For example all of the following are equivalent: {verbatim} SetInterval(120000) SetInterval(60000, 60) SetInterval(60000, 0, 1) SetInterval(0, 60, 1) SetInterval(0, 0, 2) {verbatim}

Parameters:
milliseconds  Number of milliseconds for interval.
seconds  Number of seconds for interval.
minutes  Number of minutes for interval.
hours  Number of hours for interval.
days  Number of days for interval.

Reimplemented in PTimer.

Definition at line 337 of file ptime.cxx.

References milliseconds.

Referenced by PTimer::operator=(), PICMPSocket::Ping(), PTimeInterval(), ReadFrom(), and PTimer::SetInterval().

{
  milliseconds = days;
  milliseconds *= 24;
  milliseconds += hours;
  milliseconds *= 60;
  milliseconds += minutes;
  milliseconds *= 60;
  milliseconds += seconds;
  milliseconds *= 1000;
  milliseconds += millisecs;
}


Generated by  Doxygen 1.6.0   Back to index