MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / MeasureTime

Method MeasureTime

deps/LLGL/tests/Test_Performance.cpp:112–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 }
111
112 void MeasureTime(const std::string& title, const std::function<void()>& callback)
113 {
114 // Measure time with query
115 commands->Begin();
116 commands->BeginQuery(*timerQuery, 0);
117 {
118 callback();
119 }
120 commands->EndQuery(*timerQuery, 0);
121 commands->End();
122 commandQueue->Submit(*commands);
123
124 // Print result
125 std::uint64_t result = 0;
126 while (true)
127 {
128 if (commandQueue->QueryResult(*timerQuery, 0, 1, &result, sizeof(result)))
129 {
130 std::cout << title << std::endl;
131 std::cout << "\tduration: " << result << "ns (" << (static_cast<double>(result) / 1000000.0) << "ms)" << "\n\n";
132 break;
133 }
134 }
135 }
136
137 void TestMIPMapGeneration()
138 {

Callers 1

mainFunction · 0.45

Calls 7

callbackFunction · 0.85
BeginMethod · 0.45
BeginQueryMethod · 0.45
EndQueryMethod · 0.45
EndMethod · 0.45
SubmitMethod · 0.45
QueryResultMethod · 0.45

Tested by

no test coverage detected