// Diagnostic only. Plain fixed C++ state shared by this DSO's instances. // Single main-thread, one isolated headless tick only; not concurrent-safe. // No Godot object, name, container, allocation or callback in counters. #include #include #include namespace tree_diag321 { struct Row { int64_t calls=0, inclusive_us=0, max_us=0; }; static std::array rows{}; static int64_t active=0; struct Timer { size_t index; std::chrono::steady_clock::time_point started; explicit Timer(size_t i) noexcept : index(i),started(std::chrono::steady_clock::now()) { ++active; } ~Timer() noexcept { const auto us=std::max(0,std::chrono::duration_cast(std::chrono::steady_clock::now()-started).count()); auto &r=rows[index]; ++r.calls; r.inclusive_us+=us; r.max_us=std::max(r.max_us,us); --active; } Timer(const Timer&)=delete; Timer& operator=(const Timer&)=delete; }; }