changeset 199:3132b1742eca

Add a time stamp to debug messages Add time stamps to debug messages to improve ability to profile the assembly process.
author William Astle <lost@l-w.ca>
date Fri, 16 Mar 2012 17:29:53 -0600
parents d2bed389e94a
children 348e2816ce32
files lwasm/debug.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/debug.c	Thu Mar 15 09:33:26 2012 -0600
+++ b/lwasm/debug.c	Fri Mar 16 17:29:53 2012 -0600
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
+#include <time.h>
 
 #include "lwasm.h"
 #include "instab.h"
@@ -83,7 +84,7 @@
 
 	va_start(args, fmt);
 	
-	fprintf(as -> debug_file, "DEBUG %03d: ", level);
+	fprintf(as -> debug_file, "DEBUG %03d (%ld): ", level, (long)time(NULL));
 	vfprintf(as -> debug_file, fmt, args);
 	fputc('\n', as -> debug_file);