[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / thread / thread.threads / thread.thread.this / sleep_until.pass.cpp
blob7a080651da3935f61650c6c111c8634970129559
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // UNSUPPORTED: no-threads
11 // <thread>
13 // template <class Clock, class Duration>
14 // void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
16 #include <cassert>
17 #include <chrono>
18 #include <cstdlib>
19 #include <thread>
21 #include "test_macros.h"
23 int main(int, char**)
25 typedef std::chrono::system_clock Clock;
26 typedef Clock::time_point time_point;
27 std::chrono::milliseconds ms(500);
28 time_point t0 = Clock::now();
29 std::this_thread::sleep_until(t0 + ms);
30 time_point t1 = Clock::now();
31 // NOTE: Operating systems are (by default) best effort and therefore we may
32 // have slept longer, perhaps much longer than we requested.
33 assert(t1 - t0 >= ms);
35 return 0;