ifw-fgf 2.0.0
 
Loading...
Searching...
No Matches
defines.hpp
Go to the documentation of this file.
1
6
7#ifndef FGF_LIB_DEFINES_HPP_H_
8#define FGF_LIB_DEFINES_HPP_H_
9
10#include <chrono>
11#include <thread>
12
13namespace ifw::fgf::common {
14
18 inline double Time() {
19 std::chrono::duration<double> now = std::chrono::system_clock::now().time_since_epoch();
20 return now.count();
21 }
22
26 inline void Sleep(const float sleep_time) {
27 std::chrono::duration<double> chrono_sleep_time(sleep_time);
28 std::this_thread::sleep_for(chrono_sleep_time);
29 }
30
31}
32
33#endif // FGF_LIB_DEFINES_HPP_H_
Definition binarySemaphore.hpp:45
void Sleep(const float sleep_time)
Make the calling thread sleep for the given period of time given as seconds.
Definition defines.hpp:26
double Time()
Return time as seconds since epoch with micro second precision.
Definition defines.hpp:18