Mantid
Loading...
Searching...
No Matches
AlgoTimeRegister.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
11#include "MantidKernel/Timer.h"
12#include <mutex>
13#include <thread>
14#include <vector>
15
16#include "MantidAPI/DllConfig.h"
17
18namespace Mantid {
19namespace Instrumentation {
20
24class MANTID_API_DLL AlgoTimeRegisterImpl {
25public:
28
29 class Dump {
31 const std::string m_name;
32
33 public:
34 Dump(const std::string &nm);
35 ~Dump();
36 };
37
38 void addTime(const std::string &name, const std::thread::id thread_id, const Kernel::time_point_ns &begin,
39 const Kernel::time_point_ns &end);
40 void addTime(const std::string &name, const Kernel::time_point_ns &begin, const Kernel::time_point_ns &end);
41
42 std::mutex m_mutex;
43
44private:
46
49
50 bool writeToFile();
51
53 std::string m_filename;
55};
56
58
59} // namespace Instrumentation
60} // namespace Mantid
61
62namespace Mantid {
63namespace Kernel {
64EXTERN_MANTID_API template class MANTID_API_DLL
66} // namespace Kernel
67} // namespace Mantid
std::string name
Definition Run.cpp:60
AlgoTimeRegister : simple class to dump information about executed algorithms.
AlgoTimeRegisterImpl & operator=(const AlgoTimeRegisterImpl &)=delete
AlgoTimeRegisterImpl(const AlgoTimeRegisterImpl &)=delete
Manage the lifetime of a class intended to be a singleton.
Mantid::Kernel::SingletonHolder< AlgoTimeRegisterImpl > AlgoTimeRegister
std::chrono::time_point< std::chrono::high_resolution_clock > time_point_ns
Definition Algorithm.h:39
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...