YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SystemClock.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/conf/system.h>
7
9
10#include <chrono>
11#include <thread>
12
13
15{
16 return nowSystem();
17}
18
20{
21 delaySystem(seconds);
22}
23
25{
26 return true;
27}
28
30{
31 std::this_thread::sleep_for(std::chrono::duration<double>(seconds));
32}
33
35{
36 return std::chrono::time_point_cast<std::chrono::duration<double>>(std::chrono::system_clock::now()).time_since_epoch().count();
37}
A mini-server for performing network communication in the background.
double now() override
Return the current time in seconds, relative to an arbitrary starting point.
static double nowSystem()
void delay(double seconds) override
Wait for a certain number of seconds.
bool isValid() const override
Check if time is valid (non-zero).
static void delaySystem(double seconds)