From 1e40d6c8998b154bcf3a3f63cf5c1407e34b8a62 Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Sun, 27 May 2001 00:51:02 +0000 Subject: [PATCH] reduce freqeuncy of report texmgr stats to limit perf impact --- panda/src/dxgsg/dxGraphicsStateGuardian.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx index cdeedbaaa7..c95c7b1ba1 100644 --- a/panda/src/dxgsg/dxGraphicsStateGuardian.cxx +++ b/panda/src/dxgsg/dxGraphicsStateGuardian.cxx @@ -793,16 +793,22 @@ render_frame(const AllAttributesWrapper &initial_state) { #ifdef DO_PSTATS if (_texmgrmem_total_pcollector.is_active()) { - report_texmgr_stats(); + #define TICKS_PER_GETTEXINFO (2*1000) // 2 second interval + static DWORD LastTickCount=0; + DWORD CurTickCount=GetTickCount(); + + if (CurTickCount-LastTickCount > TICKSPERINFO) { + LastTickCount=CurTickCount; + report_texmgr_stats(); + } } #endif #ifdef PRINT_TEXSTATS { - -#define TICKSPERINFO (3*1000) + #undef TICKS_PER_GETTEXINFO + #define TICKS_PER_GETTEXINFO (3*1000) static DWORD LastTickCount=0; - DWORD CurTickCount=GetTickCount(); if (CurTickCount-LastTickCount > TICKSPERINFO) {