remove \r
[extl.git] / extl / platform_ / counter / test / highperformance_counter_test.h
blob3d7a16fc8b2f8baa7eb2c0227c1ddf49d372ae2f
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: highperformance_counter_test.h
4 * Created: 08.02.17
5 * Updated: 09.01.15
7 * Brief: Unit-testing
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_PLATFORM_HIGH_PERFORMANCE_COUNTER_TEST_H
13 #define EXTL_PLATFORM_HIGH_PERFORMANCE_COUNTER_TEST_H
15 /* ///////////////////////////////////////////////////////////////////////
16 * test namespace
18 EXTL_PLATFORM_BEGIN_WHOLE_NAMESPACE
19 EXTL_TEST_NAME_BEGIN_NAMESPACE(highperformance_counter_test)
21 /* ///////////////////////////////////////////////////////////////////////
22 * Unit-testing
24 struct highperformance_counter_test
26 highperformance_counter_test()
28 highperformance_counter counter;
29 counter.start();
30 for (volatile i = 0; i < 1000000; ++i);
31 counter.stop();
32 EXTL_TEST_TRACE(_T("/* //////////////////////////////////////////////////////////////////// */"));
33 EXTL_TEST_TRACE(_T("highperformance_counter Test(100ms):\n"));
34 EXTL_TEST_TRACE(_T("Count: %u"), static_cast<e_uint32_t>(counter.count()));
35 EXTL_TEST_TRACE(_T("Seconds: %u"), static_cast<e_uint32_t>(counter.s()));
36 EXTL_TEST_TRACE(_T("MS: %u"), static_cast<e_uint32_t>(counter.ms()));
37 EXTL_TEST_TRACE(_T("US: %u"), static_cast<e_uint32_t>(counter.us()));
41 highperformance_counter_test g_highperformance_counter_test;
43 /* ///////////////////////////////////////////////////////////////////////
44 * test namespace
46 EXTL_TEST_NAME_END_NAMESPACE(highperformance_counter_test)
47 EXTL_PLATFORM_END_WHOLE_NAMESPACE
49 /* //////////////////////////////////////////////////////////////////// */
50 #endif /* EXTL_PLATFORM_HIGH_PERFORMANCE_COUNTER_TEST_H */
51 /* //////////////////////////////////////////////////////////////////// */