mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-05 04:05:54 +02:00
tools/atrf-path/gui.c: temporarily added code for sweep time measurements
This commit is contained in:
parent
0a409103eb
commit
6efe37436f
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user