(file) Return to Time.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Time.cpp between version 1.2 and 1.3

version 1.2, 2006/08/09 21:12:42 version 1.3, 2006/11/10 18:14:58
Line 105 
Line 105 
 int Time::subtract(timeval* result, timeval* x, timeval* y) int Time::subtract(timeval* result, timeval* x, timeval* y)
 { {
    /* Perform the carry for the later subtraction by updating Y. */    /* Perform the carry for the later subtraction by updating Y. */
    if (x->tv_usec < y->tv_usec) {      if (x->tv_usec < y->tv_usec)
       {
       int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;       int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
       y->tv_usec -= 1000000 * nsec;       y->tv_usec -= 1000000 * nsec;
       y->tv_sec += nsec;       y->tv_sec += nsec;
    }    }
    if (x->tv_usec - y->tv_usec > 1000000) {      if (x->tv_usec - y->tv_usec > 1000000)
       {
       int nsec = (x->tv_usec - y->tv_usec) / 1000000;       int nsec = (x->tv_usec - y->tv_usec) / 1000000;
       y->tv_usec += 1000000 * nsec;       y->tv_usec += 1000000 * nsec;
       y->tv_sec -= nsec;       y->tv_sec -= nsec;


Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2