| ... | ... |
@@ -26,7 +26,7 @@ static Apu apu[POLYPHONY]; |
| 26 | 26 |
static Mpu mpu; |
| 27 | 27 |
static Device *devscreen, *devmouse, *devctrl, *devmidi, *devaudio0; |
| 28 | 28 |
|
| 29 |
-Uint8 zoom = 0, debug = 0, reqdraw = 0; |
|
| 29 |
+Uint8 zoom = 0, debug = 0, reqdraw = 0, bench = 0; |
|
| 30 | 30 |
|
| 31 | 31 |
int |
| 32 | 32 |
clamp(int val, int min, int max) |
| ... | ... |
@@ -323,7 +323,9 @@ start(Uxn *u) |
| 323 | 323 |
while(1) {
|
| 324 | 324 |
int i; |
| 325 | 325 |
SDL_Event event; |
| 326 |
- double elapsed, start = SDL_GetPerformanceCounter(); |
|
| 326 |
+ double elapsed, start; |
|
| 327 |
+ if(!bench) |
|
| 328 |
+ start = SDL_GetPerformanceCounter(); |
|
| 327 | 329 |
while(SDL_PollEvent(&event) != 0) {
|
| 328 | 330 |
switch(event.type) {
|
| 329 | 331 |
case SDL_QUIT: |
| ... | ... |
@@ -360,8 +362,10 @@ start(Uxn *u) |
| 360 | 362 |
evaluxn(u, mempeek16(devscreen->dat, 0)); |
| 361 | 363 |
if(reqdraw) |
| 362 | 364 |
redraw(ppu.output, u); |
| 363 |
- elapsed = (SDL_GetPerformanceCounter() - start) / (double)SDL_GetPerformanceFrequency() * 1000.0f; |
|
| 364 |
- SDL_Delay(clamp(16.666f - elapsed, 0, 1000)); |
|
| 365 |
+ if(!bench){
|
|
| 366 |
+ elapsed = (SDL_GetPerformanceCounter() - start) / (double)SDL_GetPerformanceFrequency() * 1000.0f; |
|
| 367 |
+ SDL_Delay(clamp(16.666f - elapsed, 0, 1000)); |
|
| 368 |
+ } |
|
| 365 | 369 |
} |
| 366 | 370 |
return 1; |
| 367 | 371 |
} |