diff --git a/dlls/ntdll/debugtools.c b/dlls/ntdll/debugtools.c index cb08285..fc9f342 100644 --- a/dlls/ntdll/debugtools.c +++ b/dlls/ntdll/debugtools.c @@ -29,6 +29,7 @@ # include #endif #include +#include #include "wine/debug.h" #include "wine/exception.h" @@ -164,8 +165,17 @@ static int NTDLL_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_chan /* only print header if we are at the beginning of the line */ if (info->out_pos == info->output || info->out_pos[-1] == '\n') { + static struct timeval tv = {0,0}; + struct timeval now, delta; + + if(tv.tv_sec == 0) gettimeofday(&tv, NULL); + gettimeofday(&now, NULL); + timersub(&now, &tv, &delta); + + ret += wine_dbg_printf( "[%ld.%06ld]", delta.tv_sec, delta.tv_usec); + if (TRACE_ON(tid)) - ret = wine_dbg_printf( "%04x:", GetCurrentThreadId() ); + ret += wine_dbg_printf( "%04x:", GetCurrentThreadId() ); if (cls < sizeof(classes)/sizeof(classes[0])) ret += wine_dbg_printf( "%s:%s:%s ", classes[cls], channel->name, function ); }