Move Console from Scheduler into Utils
[senf.git] / Utils / Logger / TimeSource.cc
index 0cab0d9..f5baef9 100644 (file)
@@ -29,6 +29,7 @@
 // Custom includes
 #include <time.h>
 #include "../Exception.hh"
+#include "../../Scheduler/ClockService.hh"
 
 //#include "TimeSource.mpp"
 #define prefix_
@@ -46,10 +47,7 @@ prefix_ senf::log::TimeSource::~TimeSource()
 prefix_ senf::log::time_type senf::log::SystemTimeSource::operator()()
     const
 {
-    struct ::timespec tm;
-    if (::clock_gettime(CLOCK_MONOTONIC, &tm) < 0)
-        SENF_THROW_SYSTEM_EXCEPTION("::timer_gettime()");
-    return static_cast<time_type>(tm.tv_sec)*1000000000ll+tm.tv_nsec;
+    return senf::ClockService::now();
 }
 
 ///////////////////////////////cc.e////////////////////////////////////////