From 74bfec54d5b3efa6510b8a4d3f790aff2a240935 Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Mon, 28 Mar 2022 23:59:58 +0800 Subject: [PATCH] no message --- test/src/test_cpu_usage/CMakeLists.txt | 6 +++--- test/src/test_cpu_usage/test_cpu_usage.cpp | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/src/test_cpu_usage/CMakeLists.txt b/test/src/test_cpu_usage/CMakeLists.txt index fded082..0006453 100644 --- a/test/src/test_cpu_usage/CMakeLists.txt +++ b/test/src/test_cpu_usage/CMakeLists.txt @@ -13,12 +13,12 @@ string(REGEX REPLACE "(.*)/(.*)/(.*)" "\\1" PARENTPATH ${PROJECT_SOURCE_DIR}) message("last=" ${PARENTPATH}) include(${PARENTPATH}/CmakeTemplate.txt) -include_directories(./third/gtest/include) -link_directories(./third/gtest/lib) add_executable(test_cpu_usage test_cpu_usage.cpp) set_property(TARGET test_cpu_usage PROPERTY MSVC_RUNTIME_LIBRARY MultiThreadedDebugDLL) - target_include_directories(test_cpu_usage SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../../obj/inc/third/include) +message(${CMAKE_CURRENT_SOURCE_DIR}/../../../obj/inc/third/include) + +target_include_directories(test_cpu_usage SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../../obj/inc/) diff --git a/test/src/test_cpu_usage/test_cpu_usage.cpp b/test/src/test_cpu_usage/test_cpu_usage.cpp index e976066..1e5de2a 100644 --- a/test/src/test_cpu_usage/test_cpu_usage.cpp +++ b/test/src/test_cpu_usage/test_cpu_usage.cpp @@ -6,14 +6,18 @@ using namespace std; int main(int argc,char **argv){ - CProcessMonitor usage1 = CProcessMonitor(14316); + CProcessMonitor usage1(19728); + usage1.StartLog(1000); while(true){ uint64_t vmem,pmem; usage1.GetMemoryUsage(&pmem,&vmem); - std::cout<<"cpu usage is "<< usage1.GetCpuUsage() << " "<