version 1.1.1.1, 2021/03/17 00:36:46
|
version 1.1.1.2, 2023/09/27 11:14:54
|
Line 89 iperf_time_in_usecs(struct iperf_time *time)
|
Line 89 iperf_time_in_usecs(struct iperf_time *time)
|
double |
double |
iperf_time_in_secs(struct iperf_time *time) |
iperf_time_in_secs(struct iperf_time *time) |
{ |
{ |
return time->secs + time->usecs / 1000000.0; | return time->secs + time->usecs / 1000000.0; |
} |
} |
|
|
/* iperf_time_compare |
/* iperf_time_compare |
* |
* |
* Compare two timestamps |
* Compare two timestamps |
* | * |
* Returns -1 if time1 is earlier, 1 if time1 is later, |
* Returns -1 if time1 is earlier, 1 if time1 is later, |
* or 0 if the timestamps are equal. |
* or 0 if the timestamps are equal. |
*/ |
*/ |
Line 121 iperf_time_compare(struct iperf_time *time1, struct ip
|
Line 121 iperf_time_compare(struct iperf_time *time1, struct ip
|
* |
* |
* Returns 1 if the time1 is less than or equal to time2, otherwise 0. |
* Returns 1 if the time1 is less than or equal to time2, otherwise 0. |
*/ |
*/ |
int | int |
iperf_time_diff(struct iperf_time *time1, struct iperf_time *time2, struct iperf_time *diff) |
iperf_time_diff(struct iperf_time *time1, struct iperf_time *time2, struct iperf_time *diff) |
{ |
{ |
int past = 0; |
int past = 0; |
Line 132 iperf_time_diff(struct iperf_time *time1, struct iperf
|
Line 132 iperf_time_diff(struct iperf_time *time1, struct iperf
|
diff->secs = 0; |
diff->secs = 0; |
diff->usecs = 0; |
diff->usecs = 0; |
past = 1; |
past = 1; |
} | } |
else if (cmp == 1) { |
else if (cmp == 1) { |
diff->secs = time1->secs - time2->secs; |
diff->secs = time1->secs - time2->secs; |
diff->usecs = time1->usecs; |
diff->usecs = time1->usecs; |