13namespace Instrumentation {
18 : m_algoTimeRegister(atr), m_regStart_chrono(
std::chrono::high_resolution_clock::now()), m_name(nm) {}
21 const time_point_ns regFinish = std::chrono::high_resolution_clock::now();
23 std::lock_guard<std::mutex> lock(m_algoTimeRegister.m_mutex);
24 m_algoTimeRegister.addTime(m_name, std::this_thread::get_id(), m_regStart_chrono, regFinish);
30 m_info.emplace_back(name, thread_id, begin, end);
35 this->
addTime(name, std::this_thread::get_id(), begin, end);
42 fs.open(
"./algotimeregister.out", std::ios::out);
44 fs <<
"START_POINT: " << std::chrono::duration_cast<std::chrono::nanoseconds>(
m_start.time_since_epoch()).count()
46 for (
auto &elem :
m_info) {
47 const std::chrono::nanoseconds st = elem.m_begin -
m_start;
48 const std::chrono::nanoseconds fi = elem.m_end -
m_start;
49 fs <<
"ThreadID=" << elem.m_threadId <<
", AlgorithmName=" << elem.m_name <<
", StartTime=" << st.count()
50 <<
", EndTime=" << fi.count() <<
"\n";
#define PARALLEL_GET_MAX_THREADS
Dump(AlgoTimeRegister &atr, const std::string &nm)
AlgoTimeRegister : simple class to dump information about executed algorithms.
Kernel::time_point_ns m_start
std::vector< Info > m_info
void addTime(const std::string &name, const std::thread::id thread_id, const Kernel::time_point_ns &begin, const Kernel::time_point_ns &end)
std::chrono::time_point< std::chrono::high_resolution_clock > time_point_ns
Helper class which provides the Collimation Length for SANS instruments.