From e089f98c5a01532fc4c72536fbce55455969ed06 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Wed, 2 Aug 2023 14:45:46 +0800 Subject: usleep修正为sleep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_statistic.cpp | 4 ++-- 1 file 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); } -- cgit v1.2.3