Timeval: Move to osmo_clock_gettime

Change-Id: I24da3e1136c5396062662be1d10b07b4d97cfc2e
This commit is contained in:
Pau Espin 2018-12-12 17:06:06 +01:00 committed by Harald Welte
parent 0646b3ce75
commit 47031405f5
2 changed files with 10 additions and 1 deletions

View File

@ -27,8 +27,17 @@
#include "Timeval.h"
extern "C" {
#include <osmocom/core/timer.h>
}
using namespace std;
void Timeval::now()
{
osmo_clock_gettime(CLOCK_REALTIME, &mTimespec);
}
void Timeval::future(unsigned offset)
{
now();

View File

@ -47,7 +47,7 @@ class Timeval {
public:
/** Set the value to current time. */
void now() { clock_gettime(CLOCK_REALTIME, &mTimespec); }
void now();
/** Set the value to gettimeofday plus an offset. */
void future(unsigned ms);