summaryrefslogtreecommitdiffstats
path: root/aclk/schema-wrappers/schema_wrapper_utils.cc
blob: b100e20c3bd19bc391d3e0225dcb3c73f32b8fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// SPDX-License-Identifier: GPL-3.0-or-later

#include "schema_wrapper_utils.h"

void set_google_timestamp_from_timeval(struct timeval tv, google::protobuf::Timestamp *ts)
{
    ts->set_nanos(tv.tv_usec*1000);
    ts->set_seconds(tv.tv_sec);
}

void set_timeval_from_google_timestamp(const google::protobuf::Timestamp &ts, struct timeval *tv)
{
    tv->tv_sec = ts.seconds();
    tv->tv_usec = ts.nanos()/1000;
}