Bläddra i källkod

Use a dummy display to compute benchmark time to avoid relying on <time.h>.

tags/v0.99.beta17
Sam Hocevar sam 15 år sedan
förälder
incheckning
7b18489c6f
1 ändrade filer med 9 tillägg och 10 borttagningar
  1. +9
    -10
      tests/bench.c

+ 9
- 10
tests/bench.c Visa fil

@@ -1,19 +1,18 @@
#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include "caca.h"


#define TIME(desc,code) \
{\
time_t start, end;\
start = time(NULL);\
code ;\
end = time(NULL);\
printf("%-25s:%4ld\n", desc, end-start);\
#define TIME(desc, code) \
{ \
caca_display_t *dummy = caca_create_display_with_driver(NULL, "null"); \
printf("%-25s: ", desc);\
caca_refresh_display(dummy); \
code; \
caca_refresh_display(dummy); \
printf("%dms\n", caca_get_display_time(dummy) / 1000); \
caca_free_display(dummy); \
}

static void blit(int mask, int clear)


Laddar…
Avbryt
Spara