| 151 | |
| 152 | |
| 153 | struct timeval* |
| 154 | tmr_timeout( struct iperf_time* nowP ) |
| 155 | { |
| 156 | struct iperf_time now, diff; |
| 157 | int64_t usecs; |
| 158 | int past; |
| 159 | static struct timeval timeout; |
| 160 | |
| 161 | getnow( nowP, &now ); |
| 162 | /* Since the list is sorted, we only need to look at the first timer. */ |
| 163 | if ( timers == NULL ) |
| 164 | return NULL; |
| 165 | past = iperf_time_diff(&timers->time, &now, &diff); |
| 166 | if (past) |
| 167 | usecs = 0; |
| 168 | else |
| 169 | usecs = iperf_time_in_usecs(&diff); |
| 170 | timeout.tv_sec = usecs / 1000000LL; |
| 171 | timeout.tv_usec = usecs % 1000000LL; |
| 172 | return &timeout; |
| 173 | } |
| 174 | |
| 175 | |
| 176 | void |
no test coverage detected
searching dependent graphs…