2010-08-22 02:59:46 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2010-11-16 23:09:02 +01:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-08-22 02:59:46 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <chrono>
|
|
|
|
|
|
|
|
// high_resolution_clock
|
|
|
|
|
|
|
|
// check clock invariants
|
|
|
|
|
|
|
|
#include <chrono>
|
|
|
|
|
2012-12-12 22:14:28 +01:00
|
|
|
template <class _Tp>
|
|
|
|
void test(const _Tp &) {}
|
|
|
|
|
2010-08-22 02:59:46 +02:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
typedef std::chrono::high_resolution_clock C;
|
|
|
|
static_assert((std::is_same<C::rep, C::duration::rep>::value), "");
|
|
|
|
static_assert((std::is_same<C::period, C::duration::period>::value), "");
|
|
|
|
static_assert((std::is_same<C::duration, C::time_point::duration>::value), "");
|
2010-11-20 20:16:30 +01:00
|
|
|
static_assert(C::is_steady || !C::is_steady, "");
|
2012-12-12 22:14:28 +01:00
|
|
|
test(std::chrono::high_resolution_clock::is_steady);
|
2010-08-22 02:59:46 +02:00
|
|
|
}
|