implemented missing static function

This commit is contained in:
Robin Müller 2020-05-29 17:47:55 +02:00
parent 0be418a553
commit f15424be4f

View File

@ -1,10 +1,10 @@
#include <sys/time.h> #include <framework/serviceinterface/ServiceInterfaceStream.h>
#include <time.h>
#include <framework/timemanager/Clock.h> #include <framework/timemanager/Clock.h>
#include <sys/time.h>
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <linux/sysinfo.h> #include <linux/sysinfo.h>
#include <time.h>
#include <unistd.h> #include <unistd.h>
//#include <fstream> //#include <fstream>
@ -65,6 +65,15 @@ ReturnValue_t Clock::getClock_usecs(uint64_t* time) {
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
timeval Clock::getUptime() {
timeval uptime;
auto result = getUptime(&uptime);
if(result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Clock::getUptime: Error getting uptime" << std::endl;
}
return uptime;
}
ReturnValue_t Clock::getUptime(timeval* uptime) { ReturnValue_t Clock::getUptime(timeval* uptime) {
//TODO This is not posix compatible and delivers only seconds precision //TODO This is not posix compatible and delivers only seconds precision
struct sysinfo sysInfo; struct sysinfo sysInfo;