The best way

… or just generate a mapfile and enable profiling and look at that :slight_smile:

From: crusaderky@inwind.it (CRUSADER//KY)
To:
Sent: Friday, May 31, 2002 10:52 PM
Subject: Re: [SDL] The best way

My assumption is that SDL_UpdateRect() will be the slowest part of that
loop, but you might be surprised to find that the bottleneck is your own
code. It happens.

Put timers between each stage to see where the bottleneck is.

#include <time.h>
clock_t clock1,clock2;

clock1 = clock();
//put your stage 1 here
clock2 = clock();
printf(“stage 1 completed in %.0f
ms\n”,(double)(clock2-clock1)/CLOCKS_PER_SEC*1000);

clock1 = clock();
//put your stage 2 here
clock2 = clock();
printf(“stage 2 completed in %.0f
ms\n”,(double)(clock2-clock1)/CLOCKS_PER_SEC*1000);

etc.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl