From: John Tsiombikas Date: Wed, 19 May 2021 04:03:54 +0000 (+0300) Subject: dos: stop logger and write fps to the console before exiting X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=retrobench;a=commitdiff_plain;h=7fbad1ef859d78626b6080a2813d8dbfc49a6dfc dos: stop logger and write fps to the console before exiting --- diff --git a/src/dos/logger.c b/src/dos/logger.c index 70489ad..14c36e4 100644 --- a/src/dos/logger.c +++ b/src/dos/logger.c @@ -19,3 +19,8 @@ int init_logger(const char *fname) dup(fd); return 0; } + +void stop_logger(void) +{ + init_logger("CON"); +} diff --git a/src/dos/logger.h b/src/dos/logger.h index 9ef9a85..171c175 100644 --- a/src/dos/logger.h +++ b/src/dos/logger.h @@ -6,6 +6,7 @@ extern "C" { #endif int init_logger(const char *fname); +void stop_logger(void); #ifdef __cplusplus } diff --git a/src/dos/main.c b/src/dos/main.c index f048366..048aa9d 100644 --- a/src/dos/main.c +++ b/src/dos/main.c @@ -67,8 +67,10 @@ int main(int argc, char **argv) end: set_text_mode(); cleanup_video(); + stop_logger(); if(num_frames) { + printf("%d frames in %d msec\n", num_frames, time_msec); printf("avg framerate: %.1f fps\n", (10000 * num_frames / time_msec) / 10.0f); } return 0;