MCPcopy Create free account
hub / github.com/bitfieldaudio/OTTO / to_json

Method to_json

src/util/timer.cpp:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 1

to_jsonFunction · 0.45

Calls 4

objectFunction · 0.85
arrayFunction · 0.50
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected