// we use gettimeofday() now to determine the packet rcv time, since on some boxes...
[senf.git] / senf / Socket / Protocols / DatagramSocketProtocol.cc
index d9ec0b4..738c692 100644 (file)
@@ -44,6 +44,17 @@ prefix_ senf::ClockService::clock_type senf::DatagramSocketProtocol::timestamp()
     return ClockService::from_timeval(tv);
 }
 
+prefix_ senf::ClockService::clock_type senf::DatagramSocketProtocol::timestamp_system()
+    const
+{
+    // we use gettimeofday() here, since on some boxes the above ioctl() return bogus values.
+    // this may reduce the precision, but we only care about +/- 1ms, for now 
+    struct timeval tv;
+    ::gettimeofday( &tv, NULL);
+    return tv.tv_sec * 1000000000LL + tv.tv_usec * 1000LL;
+}
+
+
 ///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
 //#include "DatagramSocketProtocol.mpp"