Alternate e697dbe9c5997e35395fe158628dd8c5209481da
for Visual Studio 2022 and Windows 11.
読み取り中…
検索中…
一致する文字列を見つけられません
ConsolePerformanceCheck.cpp
[詳解]
1
5
6#include "pch.h"
8
9using namespace PerfCheck;
10
12 :PerformanceCheck(console)
13{
14 response0 = 0;
15 response1 = 0;
16 response2 = 0;
17}
18
20{
21
22}
23
25{
26 this->Core (0);
27 this->Core (1);
28 this->Core (2);
29
30 _console.Format (_T ("response0 = %dmsec response1 = %dmsec response2 = %dmsec\n"),
32
33 return TRUE;
34}
35
36BOOL ConsolePerformanceCheck::Core (const int param1)
37{
38 const int count = 1000;
40
41 Q.Start ();
42
43 _console.Clear ();
44
45 if (param1 == 2)
46 {
47 _console.SetWindowInfo (80, 25);
48 _console.SetBufferSize (80, 25);
49 }
50
51 for (int i = 0; i < count; i++)
52 {
53 if (param1 == 0)
54 {
55 _tprintf (_T ("ABCDEFGHIJKLMLOPQRSTUVWXYZ ABCDEFGHIJKLMLOPQRSTUVWXYZ ABCDEFGHIJKLMLOPQRSTUVWXYZ\n"));
56 _tprintf (_T ("☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆\n"));
57 }
58 else if (param1 == 1)
59 {
60 _console.Write (_T ("abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz\n"));
61 _console.Write (_T ("★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★\n"));
62 }
63 else
64 {
66 _console.Write (_T ("abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz\n"));
68 _console.Write (_T ("◆◇□■◆◇□■◆◇◆◇□■◆◇□■◆◇◆◇□■◆◇□■◆◇◆◇□■◆◇□■◆◇\n"));
69 }
70 }
71
72 Q.Stop ();
73
74 int msec = static_cast<int>(Q.PastTime ());
75 if (param1 == 0) response0 = msec;
76 if (param1 == 1) response1 = msec;
77 if (param1 == 2) response2 = msec;
78
79 return TRUE;
80}
Consoleクラス性能測定用
プリコンパイル済みヘッダー ファイルです。
virtual BOOL Core(const int param1)
コンソールに関するクラス
Definition: Console.h:88
DWORD APIENTRY Write(LPCTSTR lpctszString) const
コンソールに文字を出力します。
Definition: Console.cpp:54
BOOL APIENTRY SetCursorPosition(SHORT x, SHORT y) const
出力位置を設定します。
Definition: Console.cpp:90
VOID APIENTRY Format(LPCTSTR format,...) const
コンソールに文字を出力します。
Definition: Console.cpp:63
BOOL APIENTRY Clear() const
コンソールをクリアします。
Definition: Console.cpp:115
BOOL APIENTRY SetBufferSize(SHORT x, SHORT y) const
バッファサイズを設定します。
Definition: Console.cpp:97
BOOL APIENTRY SetWindowInfo(SHORT width, SHORT height) const
ウィンドウサイズを設定します。
Definition: Console.cpp:108
高分解能時間計測クラス
VOID APIENTRY Start()
計測を開始します。
double APIENTRY PastTime() const
計測開始〜計測終了までの時間を出力します。
VOID APIENTRY Stop()
計測を終了します。