std::time() is replaced with std::system_clock. The latter does not fail.