General Utility Library for C++14  2.7
Namespaces | Functions
time_util.h File Reference

Detailed Description

Declaration of time related functions for the General Utility Library.

Authors
General Utility Library Contributors
Date
Created on September 7, 2018

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the license, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

#include <chrono>
#include <thread>
#include "gul14/internal.h"
#include "gul14/Trigger.h"
Include dependency graph for time_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 gul14
 Namespace gul14 contains all functions and classes of the General Utility Library.
 

Functions

std::chrono::steady_clock::time_point gul14::tic ()
 Return the current time as a std::chrono time_point. More...
 
template<class TimeUnitType = std::chrono::duration<double>>
auto gul14::toc (std::chrono::steady_clock::time_point t0)
 Return the elapsed time in seconds (or a different unit) since the given time point. More...
 
template<class Rep , class Period >
bool gul14::sleep (const std::chrono::duration< Rep, Period > &duration, const Trigger &trg)
 Sleep for at least the given time span, with the option of being woken up from another thread. More...
 
bool gul14::sleep (double seconds, const Trigger &trg)
 Sleep for a given number of seconds, with the option of being woken up from another thread. More...
 
template<class Rep , class Period >
bool gul14::sleep (const std::chrono::duration< Rep, Period > &duration)
 Sleep for a given time span. More...
 
bool gul14::sleep (double seconds)
 Sleep for a given number of seconds. More...