5
0
mirror of https://github.com/ArduPilot/ardupilot synced 2025-02-13 03:13:57 -04:00
ardupilot/libraries/AP_HAL_SITL/Util.cpp

11 lines
272 B
C++
Raw Normal View History

#include "Util.h"
uint64_t HALSITL::Util::get_hw_rtc() const
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
const uint64_t seconds = ts.tv_sec;
const uint64_t nanoseconds = ts.tv_nsec;
return (seconds * 1000000ULL + nanoseconds/1000ULL);
}