@@ -62,37 +62,26 @@ namespace glz
62
62
63
63
std::optional<std::chrono::time_point<std::chrono::steady_clock>> t0{}; // the time of the first event
64
64
65
- std::atomic<bool > disabled = false ;
66
65
std::mutex mtx{};
67
66
68
67
template <class ... Args>
69
68
requires (sizeof ...(Args) <= 1 )
70
69
void begin (const std::string_view name, Args&&... args) noexcept
71
70
{
72
- if (disabled) {
73
- return ;
74
- }
75
71
duration (name, ' B' , std::forward<Args>(args)...);
76
72
}
77
73
78
74
template <class ... Args>
79
75
requires (sizeof ...(Args) <= 1 )
80
76
void end (const std::string_view name, Args&&... args) noexcept
81
77
{
82
- if (disabled) {
83
- return ;
84
- }
85
78
duration (name, ' E' , std::forward<Args>(args)...);
86
79
}
87
80
88
81
template <class ... Args>
89
82
requires (sizeof ...(Args) <= 1 )
90
83
void duration (const std::string_view name, const char phase, Args&&... args) noexcept
91
84
{
92
- if (disabled) {
93
- return ;
94
- }
95
-
96
85
const auto tnow = std::chrono::steady_clock::now ();
97
86
trace_event* event{};
98
87
{
@@ -115,30 +104,20 @@ namespace glz
115
104
requires (sizeof ...(Args) <= 1 )
116
105
void async_begin (const std::string_view name, Args&&... args) noexcept
117
106
{
118
- if (disabled) {
119
- return ;
120
- }
121
107
async (name, ' b' , std::forward<Args>(args)...);
122
108
}
123
109
124
110
template <class ... Args>
125
111
requires (sizeof ...(Args) <= 1 )
126
112
void async_end (const std::string_view name, Args&&... args) noexcept
127
113
{
128
- if (disabled) {
129
- return ;
130
- }
131
114
async (name, ' e' , std::forward<Args>(args)...);
132
115
}
133
116
134
117
template <class ... Args>
135
118
requires (sizeof ...(Args) <= 1 )
136
119
void async (const std::string_view name, const char phase, Args&&... args) noexcept
137
120
{
138
- if (disabled) {
139
- return ;
140
- }
141
-
142
121
const auto tnow = std::chrono::steady_clock::now ();
143
122
trace_event* event{};
144
123
{
0 commit comments