[Freeciv-Dev] (PR#10550) log FPS during sliding
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10550 >
This patch adds a LOG_DEBUG to log the FPS during sliding. If this is
committed, perhaps it'll be useful to people when trying to optimize
drawing.
jason
? newtiles
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.154
diff -u -r1.154 mapview_common.c
--- client/mapview_common.c 9 Oct 2004 16:00:34 -0000 1.154
+++ client/mapview_common.c 16 Oct 2004 03:04:10 -0000
@@ -503,6 +503,7 @@
int diff_x, diff_y;
double timing_sec = (double)smooth_center_slide_msec / 1000.0, mytime;
static struct timer *anim_timer;
+ int frames = 0;
gui_distance_vector(&diff_x, &diff_y, start_x, start_y, gui_x0, gui_y0);
anim_timer = renew_timer_start(anim_timer, TIMER_USER, TIMER_ACTIVE);
@@ -514,7 +515,12 @@
start_y + diff_y * (mytime / timing_sec));
flush_dirty();
gui_flush();
+ frames++;
} while (mytime < timing_sec);
+
+ mytime = read_timer_seconds(anim_timer);
+ freelog(LOG_DEBUG, "Got %d frames in %f seconds: %f FPS.",
+ frames, mytime, (double)frames / mytime);
} else {
base_set_mapview_origin(gui_x0, gui_y0);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#10550) log FPS during sliding,
Jason Short <=
|
|