From 0e277b89bd336eede90215ec6485df968e4954c4 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Thu, 27 Jan 2005 17:31:12 +0000 Subject: - implemented BENCH make option --- common.h | 18 +++++++++++------- render.c | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/common.h b/common.h index e453486..a86dc81 100644 --- a/common.h +++ b/common.h @@ -1,5 +1,5 @@ /* - * $Id: common.h,v 1.3 2005/01/02 19:54:22 lordjaxom Exp $ + * $Id: common.h,v 1.4 2005/01/27 17:31:12 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_COMMON_H @@ -10,18 +10,22 @@ #include #include -#ifdef DEBUG -# define Dprintf(x...) fprintf(stderr, x); -# define Dbench(x) uint64 bench_##x = time_ms(); -# define Ddiff(x) time_ms() - bench_##x +#if defined(DEBUG) || defined(BENCH) +# ifdef DEBUG +# define Dprintf(x...) fprintf(stderr, x) +# else +# define Dprintf(x...) +# endif +# define Dbench(x) uint64 bench_##x = time_ms() +# define Ddiff(t,x) fprintf(stderr, "%s took %llu ms\n", t, time_ms() - bench_##x) #else # define Dprintf(x...) # define Dbench(x) -# define Ddiff(x) +# define Ddiff(t,x) #endif #if VDRVERSNUM >= 10318 -# define time_ms() cTimeMs().Now() +# define time_ms() cTimeMs::Now() # define Apid1() Apid(0) # define Apid2() Apid(1) # define Dpid1() Dpid(0) diff --git a/render.c b/render.c index 548b776..3d3b4d7 100644 --- a/render.c +++ b/render.c @@ -1,5 +1,5 @@ /* - * $Id: render.c,v 1.28 2005/01/26 20:42:41 lordjaxom Exp $ + * $Id: render.c,v 1.29 2005/01/27 17:31:12 lordjaxom Exp $ */ #include "render.h" @@ -152,8 +152,8 @@ void cText2SkinRender::Update(void) Dbench(flush); mScreen->Flush(); - Dprintf("flush only took %llu ms\n", Ddiff(flush)); - Dprintf("complete flush took %llu ms\n", Ddiff(update)); + Ddiff("flush only", flush); + Ddiff("complete flush", update); } void cText2SkinRender::DrawObject(const cxObject *Object) -- cgit v1.2.3