ifw-fgf 2.0.0
 
Loading...
Searching...
No Matches
defines.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
9#include <chrono>
10#include <thread>
11
12namespace ifw::fgf::common {
13
15 inline double Time() {
16 std::chrono::duration<double> now = std::chrono::system_clock::now().time_since_epoch();
17 return now.count();
18 }
19
21 inline void Sleep(const float sleep_time) {
22 std::chrono::duration<double> chrono_sleep_time(sleep_time);
23 std::this_thread::sleep_for(chrono_sleep_time);
24 }
25
26}
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