Index: webrtc/system_wrappers/source/clock.cc |
diff --git a/webrtc/system_wrappers/source/clock.cc b/webrtc/system_wrappers/source/clock.cc |
index f4533fb168f74adda8fa975a3e6f41a5a2a4de18..431a66fc14d5a18eb3b47ae17192726e0e35d170 100644 |
--- a/webrtc/system_wrappers/source/clock.cc |
+++ b/webrtc/system_wrappers/source/clock.cc |
@@ -19,10 +19,32 @@ |
#include <time.h> |
#endif |
+#include <sstream> |
+ |
#include "webrtc/rtc_base/criticalsection.h" |
#include "webrtc/rtc_base/timeutils.h" |
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h" |
+extern int64_t start_time; |
+ |
+void Print(const char* fmt, ...) { |
+ const static int kBufferSize = 5000; |
+ char buffer[kBufferSize]; |
+ int64_t now_ms = webrtc::Clock::GetRealTimeClock()->TimeInMilliseconds(); |
+ if (start_time == -1) |
+ start_time = now_ms; |
+ |
+ int bytes_written; |
+ bytes_written = snprintf(buffer, kBufferSize, "%8ld - ", now_ms - start_time); |
+ va_list args; |
+ va_start(args, fmt); |
+ bytes_written += |
+ vsnprintf(buffer + bytes_written, kBufferSize - bytes_written, fmt, args); |
+ assert(bytes_written < kBufferSize); |
+ va_end(args); |
+ printf("%s\n", buffer); |
+} |
+ |
namespace webrtc { |
class RealTimeClock : public Clock { |