| 16 | ScopedTimer * active_timer; |
| 17 | |
| 18 | nlohmann::json to_json() const |
| 19 | { |
| 20 | auto obj = nlohmann::json::object(); |
| 21 | |
| 22 | if (!this->history.empty()) { |
| 23 | auto history = nlohmann::json::array(); |
| 24 | |
| 25 | for (auto const& timer_data : this->history) { |
| 26 | history.push_back(timer_data.to_json()); |
| 27 | } |
| 28 | |
| 29 | obj["history"] = history; |
| 30 | } |
| 31 | |
| 32 | return obj; |
| 33 | } |
| 34 | }; |
| 35 | |
| 36 | static std::mutex mutex; |