File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed
Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 99* [ ] AIX
1010* [ ] ...
1111
12- Example:
12+ ### Example:
1313
14+ CMakeLists.txt:
15+ ``` cmake
16+ cmake_minimum_required(VERSION 3.25)
17+
18+ project(Test LANGUAGES CXX)
19+
20+ set(CMAKE_CXX_STANDARD 20)
21+ set(CMAKE_C_STANDARD 11)
22+ set(CXX_EXTENSIONS OFF)
23+ set(C_EXTENSIONS OFF)
24+
25+ include(FetchContent)
26+ FetchContent_Declare(Process GIT_REPOSITORY "https://github.com/ttldtor/Process.git" GIT_TAG default)
27+ FetchContent_MakeAvailable(Process)
28+
29+ add_executable(${PROJECT_NAME}
30+ main.cpp
31+ )
32+
33+ target_link_libraries(${PROJECT_NAME} PRIVATE process::process)
34+
35+ ```
36+
37+ main.cpp
1438``` cpp
1539#include < process/process.hpp>
1640
Original file line number Diff line number Diff line change @@ -157,10 +157,10 @@ struct RUsageResult {
157157 std::chrono::milliseconds totalTime{};
158158
159159 explicit RUsageResult (const rusage &ru)
160- : sysTime{static_cast <std::uint64_t >(ru.ru_stime .tv_sec ) * 1000000ULL +
161- static_cast <std::uint64_t >(ru.ru_stime .tv_usec )},
162- userTime{static_cast <std::uint64_t >(ru.ru_utime .tv_sec ) * 1000000ULL +
163- static_cast <std::uint64_t >(ru.ru_utime .tv_usec )},
160+ : sysTime{static_cast <std::uint64_t >(ru.ru_stime .tv_sec ) * 1000ULL +
161+ static_cast <std::uint64_t >(ru.ru_stime .tv_usec ) / 1000ULL },
162+ userTime{static_cast <std::uint64_t >(ru.ru_utime .tv_sec ) * 1000ULL +
163+ static_cast <std::uint64_t >(ru.ru_utime .tv_usec ) / 1000ULL },
164164 totalTime{sysTime + userTime} {
165165 }
166166};
You can’t perform that action at this time.
0 commit comments