remove \r
[extl.git] / extl / platform_ / windows / counter / test / threadtimes_counter_test.h
blob106c693cffc01ed08236ed442e8b6b3e96aceb55
1 /* ///////////////////////////////////////////////////////////////////////
2 * File: threadtimes_counter_test.h
4 * Created: 08.02.17
5 * Updated: 08.05.06
7 * Brief: Unit-testing
9 * [<Home>]
10 * Copyright (c) 2008-2020, Waruqi All rights reserved.
11 * //////////////////////////////////////////////////////////////////// */
12 #ifndef EXTL_PLATFORM_WINDOWS_THREAD_TIMES_COUNTER_TEST_H
13 #define EXTL_PLATFORM_WINDOWS_THREAD_TIMES_COUNTER_TEST_H
15 /* ///////////////////////////////////////////////////////////////////////
16 * test namespace
18 EXTL_WINDOWS_BEGIN_WHOLE_NAMESPACE
19 EXTL_TEST_NAME_BEGIN_NAMESPACE(threadtimes_counter_test)
21 /* ///////////////////////////////////////////////////////////////////////
22 * Unit-testing
24 struct threadtimes_counter_test
26 threadtimes_counter_test()
28 threadtimes_counter counter;
29 counter.start();
30 Sleep(100);
31 counter.end();
32 EXTL_TEST_TRACE(_T("/* //////////////////////////////////////////////////////////////////// */"));
33 EXTL_TEST_TRACE(_T("threadtimes_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\n"), static_cast<e_uint32_t>(counter.us()));
39 EXTL_TEST_TRACE(_T("Kernel Count: %u"), static_cast<e_uint32_t>(counter.kernel_count()));
40 EXTL_TEST_TRACE(_T("Kernel Seconds: %u"), static_cast<e_uint32_t>(counter.kernel_s()));
41 EXTL_TEST_TRACE(_T("Kernel MS: %u"), static_cast<e_uint32_t>(counter.kernel_ms()));
42 EXTL_TEST_TRACE(_T("Kernel US: %u\n"), static_cast<e_uint32_t>(counter.kernel_us()));
44 EXTL_TEST_TRACE(_T("User Count: %u"), static_cast<e_uint32_t>(counter.user_count()));
45 EXTL_TEST_TRACE(_T("User Seconds: %u"), static_cast<e_uint32_t>(counter.user_s()));
46 EXTL_TEST_TRACE(_T("User MS: %u"), static_cast<e_uint32_t>(counter.user_ms()));
47 EXTL_TEST_TRACE(_T("User US: %u"), static_cast<e_uint32_t>(counter.user_us()));
51 threadtimes_counter_test g_threadtimes_counter_test;
53 /* ///////////////////////////////////////////////////////////////////////
54 * test namespace
56 EXTL_TEST_NAME_END_NAMESPACE(threadtimes_counter_test)
57 EXTL_WINDOWS_END_WHOLE_NAMESPACE
59 /* //////////////////////////////////////////////////////////////////// */
60 #endif /* EXTL_PLATFORM_WINDOWS_THREAD_TIMES_COUNTER_TEST_H */
61 /* //////////////////////////////////////////////////////////////////// */