1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: libcpp-has-no-threads
26 typedef std::chrono::system_clock Clock;
27 typedef Clock::time_point time_point;
28 typedef Clock::duration duration;
29 typedef std::chrono::milliseconds ms;
30 typedef std::chrono::nanoseconds ns;
34 time_point t0 = Clock::now();
36 time_point t1 = Clock::now();
38 ns d = t1 - t0 - ms(250);
39 assert(d < ms(50)); // within 50ms
46 std::this_thread::sleep_for(ms(250));