dos: stop logger and write fps to the console before exiting
authorJohn Tsiombikas <nuclear@member.fsf.org>
Wed, 19 May 2021 04:03:54 +0000 (07:03 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Wed, 19 May 2021 04:03:54 +0000 (07:03 +0300)
src/dos/logger.c
src/dos/logger.h
src/dos/main.c

index 70489ad..14c36e4 100644 (file)
@@ -19,3 +19,8 @@ int init_logger(const char *fname)
        dup(fd);
        return 0;
 }
+
+void stop_logger(void)
+{
+       init_logger("CON");
+}
index 9ef9a85..171c175 100644 (file)
@@ -6,6 +6,7 @@ extern "C" {
 #endif
 
 int init_logger(const char *fname);
+void stop_logger(void);
 
 #ifdef __cplusplus
 }
index f048366..048aa9d 100644 (file)
@@ -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;