Change Details
tools/atrf-path/gui.c |
75 | 75 | } |
76 | 76 | |
77 | 77 | |
| 78 | /* --- temporarily, for optimizing --- */ |
| 79 | |
| 80 | #include <sys/time.h> |
| 81 | |
| 82 | |
| 83 | static double t0; |
| 84 | |
| 85 | |
| 86 | static 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 | |
| 95 | static void tstart(void) |
| 96 | { |
| 97 | t0 = t(); |
| 98 | } |
| 99 | |
| 100 | |
| 101 | static void tstop(void) |
| 102 | { |
| 103 | fprintf(stderr, "%.3f\n", t()-t0); |
| 104 | } |
| 105 | |
| 106 | |
78 | 107 | void gui(const struct sweep *sweep) |
79 | 108 | { |
80 | 109 | SDL_Surface *surf; |
... | ... | |
99 | 128 | if (event.type == SDL_KEYDOWN || |
100 | 129 | event.type == SDL_QUIT) |
101 | 130 | return; |
| 131 | tstart(); |
102 | 132 | do_sweep(sweep, res); |
| 133 | tstop(); |
103 | 134 | |
104 | 135 | SDL_LockSurface(surf); |
105 | 136 | |
Download the corresponding diff file