summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2023-08-02 14:45:46 +0800
committerliuxueli <[email protected]>2023-08-02 14:45:46 +0800
commite089f98c5a01532fc4c72536fbce55455969ed06 (patch)
treeaf5380c962669f7a8c71268307c9058f1feffdd8
parentca6f5be56869f06c5fe60e242c9d0f637b26485c (diff)
usleep修正为sleepv6.0.46
-rw-r--r--src/tsg_statistic.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tsg_statistic.cpp b/src/tsg_statistic.cpp
index a15dc7b..312ade4 100644
--- a/src/tsg_statistic.cpp
+++ b/src/tsg_statistic.cpp
@@ -288,7 +288,7 @@ static void *tsg_statistic_thread(void *arg)
fieldstat_passive_output(g_tsg_statis_para.fs_network.metrics_handle);
- usleep(g_tsg_statis_para.fs_network.cycle_interval_ms*1000);
+ sleep(g_tsg_statis_para.fs_network.cycle_interval_ms/1000);
}
pthread_exit(NULL);
@@ -547,7 +547,7 @@ void tsg_metric_destroy(void)
if(g_tsg_statis_para.fs_network.metrics_handle!=NULL)
{
g_tsg_statis_para.fs_network.thread_alive = 0;
- usleep((g_tsg_statis_para.fs_network.cycle_interval_ms+1000)*1000);
+ sleep((g_tsg_statis_para.fs_network.cycle_interval_ms/1000));
pthread_join(g_tsg_statis_para.fs_network.stat_thread_id, NULL);
fieldstat_instance_free(g_tsg_statis_para.fs_network.metrics_handle);
}