diff --git a/main.c b/main.c index 4f39e02..30b8ccd 100644 --- a/main.c +++ b/main.c @@ -2,6 +2,8 @@ #include #include +#include + #ifdef __APPLE__ #include #else @@ -130,6 +132,8 @@ int main(int argn, char **argv) { else stop_point = -2.5; + clock_t start = clock(); + while(zoom > stop_point) { for (current_line = 0; current_line < res_y; current_line++) @@ -219,6 +223,8 @@ int main(int argn, char **argv) { SDL_Flip(screen); } + printf("Time elapsed %0.5f seconds\n", ((double)clock() - start) / CLOCKS_PER_SEC); + // Clean up ret = clFlush(command_queue); ret = clFinish(command_queue); diff --git a/mandel_classic.c b/mandel_classic.c index d65bc5c..968147d 100644 --- a/mandel_classic.c +++ b/mandel_classic.c @@ -4,6 +4,8 @@ #include #include +#include + #include #define MAX_SOURCE_SIZE (0x100000) @@ -386,6 +388,9 @@ int main(int argn, char **argv) else stop_point = -2.5; + // We measure the time to do the zooming + clock_t start = clock(); + while(zoom > stop_point) { int iteration, max_iteration, x, y, res; @@ -465,7 +470,7 @@ int main(int argn, char **argv) SDL_Flip(screen); } - // printf("Max Iteration value: %d\n", max_iter); + printf("Time elapsed %0.5f seconds\n", ((double)clock() - start) / CLOCKS_PER_SEC); SDL_Event ev; int active;