mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-03 07:15:29 -04:00
render: make frame rendering time measuring optional
This commit is contained in:
parent
6e55be1557
commit
71c7219b35
1 changed files with 6 additions and 0 deletions
6
render.c
6
render.c
|
|
@ -293,8 +293,12 @@ static const struct wl_callback_listener frame_listener = {
|
||||||
void
|
void
|
||||||
grid_render(struct terminal *term)
|
grid_render(struct terminal *term)
|
||||||
{
|
{
|
||||||
|
#define TIME_FRAME_RENDERING 0
|
||||||
|
|
||||||
|
#if TIME_FRAME_RENDERING
|
||||||
struct timeval start_time;
|
struct timeval start_time;
|
||||||
gettimeofday(&start_time, NULL);
|
gettimeofday(&start_time, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
static int last_cursor;
|
static int last_cursor;
|
||||||
|
|
||||||
|
|
@ -436,6 +440,7 @@ grid_render(struct terminal *term)
|
||||||
|
|
||||||
wl_surface_commit(term->wl.surface);
|
wl_surface_commit(term->wl.surface);
|
||||||
|
|
||||||
|
#if TIME_FRAME_RENDERING
|
||||||
struct timeval end_time;
|
struct timeval end_time;
|
||||||
gettimeofday(&end_time, NULL);
|
gettimeofday(&end_time, NULL);
|
||||||
|
|
||||||
|
|
@ -443,6 +448,7 @@ grid_render(struct terminal *term)
|
||||||
timersub(&end_time, &start_time, &render_time);
|
timersub(&end_time, &start_time, &render_time);
|
||||||
LOG_INFO("frame rendered in %lds %ldms",
|
LOG_INFO("frame rendered in %lds %ldms",
|
||||||
render_time.tv_sec, render_time.tv_usec / 1000);
|
render_time.tv_sec, render_time.tv_usec / 1000);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue