9 static uint64_t lastTime = 0;
11 using namespace std::chrono;
12 uint64_t now = duration_cast<microseconds>(
13 steady_clock::now().time_since_epoch()).count();
22 if (now < lastTime)
return lastTime;
29 std::this_thread::sleep_for(std::chrono::microseconds(us));
uint64_t getTime()
Get current (real) time in us.
void sleep(uint64_t us)
Sleep for the specified amount of time (in us).