1 /* ///////////////////////////////////////////////////////////////////////
2 * File: highperformance_counter_test.h
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 /* ///////////////////////////////////////////////////////////////////////
18 EXTL_PLATFORM_BEGIN_WHOLE_NAMESPACE
19 EXTL_TEST_NAME_BEGIN_NAMESPACE(highperformance_counter_test
)
21 /* ///////////////////////////////////////////////////////////////////////
24 struct highperformance_counter_test
26 highperformance_counter_test()
28 highperformance_counter counter
;
30 for (volatile i
= 0; i
< 1000000; ++i
);
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 /* ///////////////////////////////////////////////////////////////////////
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 /* //////////////////////////////////////////////////////////////////// */