Date:2011-04-13 13:54:26 (12 years 11 months ago)
Author:Werner Almesberger
Commit:6efe37436f535f35e223f21f336e2f5afd475237
Message:tools/atrf-path/gui.c: temporarily added code for sweep time measurements

Files: tools/atrf-path/gui.c (2 diffs)

Change Details

tools/atrf-path/gui.c
7575}
7676
7777
78/* --- temporarily, for optimizing --- */
79
80#include <sys/time.h>
81
82
83static double t0;
84
85
86static double t(void)
87{
88    struct timeval tv;
89
90    gettimeofday(&tv, NULL);
91    return tv.tv_sec+tv.tv_usec/1000000.0;
92}
93
94
95static void tstart(void)
96{
97    t0 = t();
98}
99
100
101static void tstop(void)
102{
103    fprintf(stderr, "%.3f\n", t()-t0);
104}
105
106
78107void gui(const struct sweep *sweep)
79108{
80109    SDL_Surface *surf;
...... 
99128            if (event.type == SDL_KEYDOWN ||
100129                event.type == SDL_QUIT)
101130                return;
131        tstart();
102132        do_sweep(sweep, res);
133        tstop();
103134
104135        SDL_LockSurface(surf);
105136

Archive Download the corresponding diff file



interactive