iperf: Make the use of CLOCK_MONOTONIC conditional for now
This commit is contained in:
parent
37bc863eb7
commit
cc37729e29
@ -10,7 +10,6 @@ config NETUTILS_IPERF
|
|||||||
select NETUTILS_NETLIB
|
select NETUTILS_NETLIB
|
||||||
select LIBC_FLOATINGPOINT
|
select LIBC_FLOATINGPOINT
|
||||||
select SYSTEM_ARGTABLE3
|
select SYSTEM_ARGTABLE3
|
||||||
select CLOCK_MONOTONIC
|
|
||||||
---help---
|
---help---
|
||||||
Enable the \"iperf example\"
|
Enable the \"iperf example\"
|
||||||
|
|
||||||
|
@ -231,9 +231,14 @@ static void iperf_report_task(void *arg)
|
|||||||
struct timespec start;
|
struct timespec start;
|
||||||
uintmax_t now_len;
|
uintmax_t now_len;
|
||||||
int ret;
|
int ret;
|
||||||
|
#ifdef CONFIG_CLOCK_MONOTONIC
|
||||||
|
const clockid_t clockid = CLOCK_MONOTONIC;
|
||||||
|
#else
|
||||||
|
const clockid_t clockid = CLOCK_REALTIME;
|
||||||
|
#endif
|
||||||
|
|
||||||
now_len = s_iperf_ctrl.total_len;
|
now_len = s_iperf_ctrl.total_len;
|
||||||
ret = clock_gettime(CLOCK_MONOTONIC, &now);
|
ret = clock_gettime(clockid, &now);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "clock_gettime failed\n");
|
fprintf(stderr, "clock_gettime failed\n");
|
||||||
@ -251,7 +256,7 @@ static void iperf_report_task(void *arg)
|
|||||||
last_len = now_len;
|
last_len = now_len;
|
||||||
last = now;
|
last = now;
|
||||||
now_len = s_iperf_ctrl.total_len;
|
now_len = s_iperf_ctrl.total_len;
|
||||||
ret = clock_gettime(CLOCK_MONOTONIC, &now);
|
ret = clock_gettime(clockid, &now);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "clock_gettime failed\n");
|
fprintf(stderr, "clock_gettime failed\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user