What is the difference between std::condition_variable::wait_for and std::condition_variable::wait_until?

The difference is in how the wait duration is represented: wait_for takes a relative time (“wait for up to 10 seconds”), whereas wait_until takes an absolute time (“wait until 12:00 on October 30, 2012”).

Compare the declarations of the time parameters:

// wait_for:
const std::chrono::duration<Rep, Period>& rel_time

// wait_until:
const std::chrono::time_point<Clock, Duration>& abs_time

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)