From b2095aa2c9ade769c4772ec0fcc2f61e54e5f265 Mon Sep 17 00:00:00 2001 From: yangwei Date: Wed, 25 May 2022 18:38:26 +0800 Subject: 🧪 test(fs2_test): 调整测试sleep时间和循环测试次数,增加耗时打印输出 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/fs2_test.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/fs2_test.cpp b/test/fs2_test.cpp index 23db6df..5b4af3f 100644 --- a/test/fs2_test.cpp +++ b/test/fs2_test.cpp @@ -102,9 +102,11 @@ int main(int argc, char *argv[]) char *url_path = (char *)"/prometheus"; FS_library_set_prometheus_url_path(url_path); FS_library_init(); - - for (int repeat_cnt = 0; repeat_cnt < 10; repeat_cnt++) + struct timespec start; + long time_use; + for (int repeat_cnt = 0; repeat_cnt < 2; repeat_cnt++) { + record_time_start(&start); handle = FS_create_handle(); @@ -201,9 +203,11 @@ int main(int argc, char *argv[]) FS_stop(&handle); - printf("fs2 stoped cnt = %d, will sleep 1s\n", repeat_cnt); + time_use = record_time_elapse_us(&start); + printf("fs2 stoped cnt = %d, cost %ld us, will sleep 1s\n", repeat_cnt, time_use); sleep(1); } + printf("Start FS library destoryed ...\n"); FS_library_destroy(); printf("FS library destoryed, will sleep 30s\n"); sleep(30); -- cgit v1.2.3