Timeval: Move to osmo_clock_gettime
Change-Id: I24da3e1136c5396062662be1d10b07b4d97cfc2e
This commit is contained in:
parent
0646b3ce75
commit
47031405f5
|
@ -27,8 +27,17 @@
|
||||||
|
|
||||||
#include "Timeval.h"
|
#include "Timeval.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include <osmocom/core/timer.h>
|
||||||
|
}
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
void Timeval::now()
|
||||||
|
{
|
||||||
|
osmo_clock_gettime(CLOCK_REALTIME, &mTimespec);
|
||||||
|
}
|
||||||
|
|
||||||
void Timeval::future(unsigned offset)
|
void Timeval::future(unsigned offset)
|
||||||
{
|
{
|
||||||
now();
|
now();
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Timeval {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** Set the value to current time. */
|
/** Set the value to current time. */
|
||||||
void now() { clock_gettime(CLOCK_REALTIME, &mTimespec); }
|
void now();
|
||||||
|
|
||||||
/** Set the value to gettimeofday plus an offset. */
|
/** Set the value to gettimeofday plus an offset. */
|
||||||
void future(unsigned ms);
|
void future(unsigned ms);
|
||||||
|
|
Loading…
Reference in New Issue