diff --git a/xwords4/linux/linuxutl.c b/xwords4/linux/linuxutl.c index d41f779de..52e7474ca 100644 --- a/xwords4/linux/linuxutl.c +++ b/xwords4/linux/linuxutl.c @@ -42,16 +42,16 @@ static void debugf( const char* format, va_list ap ) { - struct timeval tv; - struct timezone tz; - gettimeofday( &tv, &tz ); + struct timespec tp = {0}; + int res = clock_gettime( CLOCK_REALTIME, &tp ); + XP_ASSERT( 0 == res ); + struct tm* timp = localtime( &tp.tv_sec ); - struct tm* timp = localtime( &tv.tv_sec ); + fprintf( stderr, "<%d:%lx> %.2d:%.2d:%.2d:%03ld ", getpid(), + pthread_self(), timp->tm_hour, timp->tm_min, timp->tm_sec, + tp.tv_nsec / 1000000 ); - fprintf( stderr, "<%d:%lx>%.2d:%.2d:%.2d:", getpid(), - pthread_self(), timp->tm_hour, timp->tm_min, timp->tm_sec ); - - vfprintf(stderr, format, ap ); + vfprintf( stderr, format, ap ); fprintf( stderr, "%c", '\n' ); }