RobotsIO
Loading...
Searching...
No Matches
src
RobotsIO
src
Utils
ClockYarp.cpp
1
/*
2
* Copyright (C) 2020 Istituto Italiano di Tecnologia (IIT)
3
*
4
* This software may be modified and distributed under the terms of the
5
* BSD 3-Clause license. See the accompanying LICENSE file for details.
6
*/
7
8
#include <RobotsIO/Utils/ClockYarp.h>
9
10
#include <stdexcept>
11
12
#include <yarp/os/Time.h>
13
14
using namespace
RobotsIO::Utils;
15
16
17
ClockYarp::ClockYarp()
18
{
19
if
(!yarp_.checkNetwork())
20
{
21
throw
(std::runtime_error(log_name_ +
"::ctor. Error: YARP network is not available."
));
22
}
23
}
24
25
26
ClockYarp::~ClockYarp()
27
{}
28
29
30
double
ClockYarp::now()
const
31
{
32
return
yarp::os::Time::now();
33
}
34
35
36
void
ClockYarp::delay(
const
int
& milliseconds)
const
37
{
38
return
yarp::os::Time::delay(
double
(milliseconds) / 1000.0);
39
}
Generated by
1.9.6