1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-23 12:37:42 +02:00

tools/atrf-path/gui.c: temporarily added code for sweep time measurements

This commit is contained in:
Werner Almesberger 2011-04-13 08:54:26 -03:00
parent 0a409103eb
commit 6efe37436f

View File

@ -75,6 +75,35 @@ static void clear(SDL_Surface *s)
}
/* --- temporarily, for optimizing --- */
#include <sys/time.h>
static double t0;
static double t(void)
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec+tv.tv_usec/1000000.0;
}
static void tstart(void)
{
t0 = t();
}
static void tstop(void)
{
fprintf(stderr, "%.3f\n", t()-t0);
}
void gui(const struct sweep *sweep)
{
SDL_Surface *surf;
@ -99,7 +128,9 @@ void gui(const struct sweep *sweep)
if (event.type == SDL_KEYDOWN ||
event.type == SDL_QUIT)
return;
tstart();
do_sweep(sweep, res);
tstop();
SDL_LockSurface(surf);