瀏覽代碼

Drop difftime from DEBUG_TRACE_FUNC()

xtne6f 5 年之前
父節點
當前提交
9755e88852
共有 1 個文件被更改,包括 1 次插入11 次删除
  1. 1 11
      src/civetweb.c

+ 1 - 11
src/civetweb.c

@@ -1740,27 +1740,18 @@ static void
 DEBUG_TRACE_FUNC(const char *func, unsigned line, const char *fmt, ...)
 DEBUG_TRACE_FUNC(const char *func, unsigned line, const char *fmt, ...)
 {
 {
 	va_list args;
 	va_list args;
-	uint64_t nsnow;
-	static uint64_t nslast;
 	struct timespec tsnow;
 	struct timespec tsnow;
 
 
 	/* Get some operating system independent thread id */
 	/* Get some operating system independent thread id */
 	unsigned long thread_id = mg_current_thread_id();
 	unsigned long thread_id = mg_current_thread_id();
 
 
 	clock_gettime(CLOCK_REALTIME, &tsnow);
 	clock_gettime(CLOCK_REALTIME, &tsnow);
-	nsnow = ((uint64_t)tsnow.tv_sec) * ((uint64_t)1000000000)
-	        + ((uint64_t)tsnow.tv_nsec);
-
-	if (!nslast) {
-		nslast = nsnow;
-	}
 
 
 	flockfile(DEBUG_TRACE_STREAM);
 	flockfile(DEBUG_TRACE_STREAM);
 	fprintf(DEBUG_TRACE_STREAM,
 	fprintf(DEBUG_TRACE_STREAM,
-	        "*** %lu.%09lu %12" INT64_FMT " %lu %s:%u: ",
+	        "*** %lu.%09lu %lu %s:%u: ",
 	        (unsigned long)tsnow.tv_sec,
 	        (unsigned long)tsnow.tv_sec,
 	        (unsigned long)tsnow.tv_nsec,
 	        (unsigned long)tsnow.tv_nsec,
-	        nsnow - nslast,
 	        thread_id,
 	        thread_id,
 	        func,
 	        func,
 	        line);
 	        line);
@@ -1770,7 +1761,6 @@ DEBUG_TRACE_FUNC(const char *func, unsigned line, const char *fmt, ...)
 	putc('\n', DEBUG_TRACE_STREAM);
 	putc('\n', DEBUG_TRACE_STREAM);
 	fflush(DEBUG_TRACE_STREAM);
 	fflush(DEBUG_TRACE_STREAM);
 	funlockfile(DEBUG_TRACE_STREAM);
 	funlockfile(DEBUG_TRACE_STREAM);
-	nslast = nsnow;
 }
 }
 #endif /* NEED_DEBUG_TRACE_FUNC */
 #endif /* NEED_DEBUG_TRACE_FUNC */