]>
gcc.gnu.org Git - gcc.git/blob - libstdc++-v3/testsuite/util/slow_clock.h
bae734f76c84cdf19eed12d4389b5a4cbacf83f4
3 // Copyright (C) 2018-2020 Free Software Foundation, Inc.
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 3, or (at
8 // your option) any later version.
10 // This library is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this library; see the file COPYING3. If not see
17 // <http://www.gnu.org/licenses/>.
20 // A clock that ticks at a third of the speed of system_clock that can be used
21 // to ensure that functions with timeouts don't erroneously return early.
27 using rep
= std::chrono::system_clock::rep
;
28 using period
= std::chrono::system_clock::period
;
29 using duration
= std::chrono::system_clock::duration
;
30 using time_point
= std::chrono::time_point
<slow_clock
, duration
>;
31 static constexpr bool is_steady
= false;
33 static time_point
now()
35 auto real
= std::chrono::system_clock::now();
36 return time_point
{real
.time_since_epoch() / 3};
This page took 0.036677 seconds and 4 git commands to generate.