#include <stdio.h>#include <stdlib.h>#include "events.hh"Include dependency graph for events.cc:

Go to the source code of this file.
Functions | |
| int | TimevalCmp (struct timeval *x, struct timeval *y) |
| void | TimevalSub (struct timeval *x, struct timeval *y, struct timeval *tv) |
| void | TimevalAddusecs (struct timeval *tv, int usecs) |
|
||||||||||||
|
Definition at line 58 of file events.cc. Referenced by EventQueue::setDelay().
00059 {
00060 tv->tv_usec += usecs;
00061 if (tv->tv_usec > 1000000){
00062 tv->tv_sec += tv->tv_usec / 1000000;
00063 tv->tv_usec = tv->tv_usec % 1000000;
00064 }
00065 }
|
|
||||||||||||
|
Definition at line 32 of file events.cc. Referenced by EventQueue::eqTopInPast(), EventQueue::eventCmp(), DiffusionRouting::run(), DiffusionRouting::send(), and TimevalSub().
00033 {
00034 if (x->tv_sec > y->tv_sec) return 1;
00035 if (x->tv_sec < y->tv_sec) return -1;
00036 if (x->tv_usec > y->tv_usec) return 1;
00037 if (x->tv_usec < y->tv_usec) return -1;
00038 return 0;
00039 }
|
|
||||||||||||||||
|
Definition at line 41 of file events.cc. References TimevalCmp(). Referenced by EventQueue::eqNextTimer().
00042 {
00043 if (TimevalCmp(x, y) < 0)
00044 tv->tv_sec = tv->tv_usec = 0;
00045 else{
00046 *tv = *x;
00047 // borrow..
00048 if (tv->tv_usec < y->tv_usec){
00049 tv->tv_usec += 1000000;
00050 tv->tv_sec--;
00051 }
00052 // sub
00053 tv->tv_usec -= y->tv_usec;
00054 tv->tv_sec -= y->tv_sec;
00055 }
00056 }
|
Here is the call graph for this function:

1.3.3