UniRec
3.3.2
Loading...
Searching...
No Matches
include
unirec++
urTime.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <sys/time.h>
4
#include <
unirec/unirec.h
>
5
6
namespace
Nemea
{
7
8
struct
UrTime
{
9
ur_time_t
time
;
10
11
static
UrTime
now
()
12
{
13
struct
timeval t;
14
gettimeofday(&t,
nullptr
);
15
return
{
ur_time_from_sec_msec
(t.tv_sec, t.tv_usec / 1000)};
16
}
17
};
18
19
static_assert
(
sizeof
(UrTime) ==
sizeof
(
ur_time_t
),
"Invalid header definition"
);
20
21
}
// namespace Nemea
ur_time_from_sec_msec
#define ur_time_from_sec_msec(sec, msec)
Convert seconds and milliseconds to ur_time_t.
Definition
ur_time.h:116
ur_time_t
uint64_t ur_time_t
Type of timestamps used in UniRec Timestamps in UniRec are stored as number of seconds from Unix epoc...
Definition
ur_time.h:61
Nemea
Definition
bidirectionalInterface.cpp:14
Nemea::UrTime
Definition
urTime.hpp:8
Nemea::UrTime::time
ur_time_t time
Definition
urTime.hpp:9
Nemea::UrTime::now
static UrTime now()
Definition
urTime.hpp:11
unirec.h
Definition of UniRec structures and functions.
Generated by
1.12.0