Profile tasks execution in async::threadpool

This commit is contained in:
Nikita Lisitsa 2025-09-07 13:59:06 +03:00
parent 5c0d4d8d29
commit 1b548f1ba3
2 changed files with 7 additions and 1 deletions

View file

@ -3,4 +3,8 @@ file(GLOB_RECURSE PSEMEK_ASYNC_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "s
psemek_add_library(psemek-async ${PSEMEK_ASYNC_HEADERS} ${PSEMEK_ASYNC_SOURCES}) psemek_add_library(psemek-async ${PSEMEK_ASYNC_HEADERS} ${PSEMEK_ASYNC_SOURCES})
target_include_directories(psemek-async PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(psemek-async PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(psemek-async PUBLIC psemek-log psemek-util) target_link_libraries(psemek-async PUBLIC
psemek-log
psemek-util
psemek-prof
)

View file

@ -3,6 +3,7 @@
#include <psemek/util/unused.hpp> #include <psemek/util/unused.hpp>
#include <psemek/util/to_string.hpp> #include <psemek/util/to_string.hpp>
#include <psemek/util/exception.hpp> #include <psemek/util/exception.hpp>
#include <psemek/prof/profiler.hpp>
#include <psemek/log/log.hpp> #include <psemek/log/log.hpp>
@ -32,6 +33,7 @@ namespace psemek::async
try try
{ {
prof::profiler prof("task");
task(); task();
} }
catch (util::exception const & e) catch (util::exception const & e)