#pragma once // Diagnostics: the time spent in the client renderer's methods (the engine's inner engine, and the resources it made), // summed, so the stats can tell it from the rest of a frame. #include #include namespace t5de { // QueryPerformanceCounter ticks spent in the client renderer's methods so far. inline std::int64_t innerTicks = 0; // Adds its lifetime to innerTicks. class InnerCall { public: InnerCall() { QueryPerformanceCounter(&start_); } InnerCall(const InnerCall&) = delete; InnerCall& operator=(const InnerCall&) = delete; ~InnerCall() { LARGE_INTEGER end; QueryPerformanceCounter(&end); innerTicks += end.QuadPart - start_.QuadPart; } private: LARGE_INTEGER start_; }; } // namespace t5de