Alternate e697dbe9c5997e35395fe158628dd8c5209481da
for Visual Studio 2022 and Windows 11.
読み取り中…
検索中…
一致する文字列を見つけられません
VectorPerformanceCheck.cpp
[詳解]
1
5
6#include "pch.h"
8#include "Freight.hpp"
9
10using namespace PerfCheck;
11
13 :PerformanceCheck (console)
14{
15}
16
18{
19}
20
22{
23 int count = alt::Utility::ReadIniFile(CONFIG_FILE, _T("Vector"), _T("Count"), -1);
24 if (count == -1) return FALSE;
25
26 int size = alt::Utility::ReadIniFile(CONFIG_FILE, _T("Vector"), _T("Size"), -1);
27 if (size == -1) return FALSE;
28
29 _console.Format (_T ("Count=%d Size=%d\n"), count, size);
30
31 return this->Core (count, size);
32}
33
34BOOL VectorPerformanceCheck::Core (const int param1, const int param2)
35{
37 typedef alt::skeleton::Freight<BYTE> ByteFreight;
38 LPBYTE lpbyData = new BYTE[param2];
39 ZeroMemory (lpbyData, param2);
40 std::vector<ByteFreight> container;
41
42 Q.Start ();
43
44 for (int i = 0; i < param1; i++)
45 {
46 ByteFreight byteFreight (lpbyData, param2);
47 container.push_back (byteFreight);
48 }
49
50 for (int i = 0; i < param1; i++)
51 {
52 ByteFreight byteFreight (lpbyData, param2);
53 container.insert (container.begin (), byteFreight);
54 }
55
56 for (int i = 0; i < param1; i++)
57 {
58 ByteFreight byteFreight (lpbyData, param2);
59 container.insert (container.end (), byteFreight);
60 }
61
62 for (int i = 0; i < param1; i++)
63 {
64 container.erase (container.begin ());
65 }
66
67 std::vector<ByteFreight> container2 = container;
68 container.clear ();
69
70 for (int i = 0; i < container2.size (); i++)
71 {
72 ByteFreight value = container2.at (i);
73 LPBYTE lpbyData = value.GetData ();
74 size_t size = value.GetSize ();
75 }
76
77 container2.clear ();
78
79 Q.Stop ();
80
81 delete[] lpbyData;
82 int msec = static_cast<int>(Q.PastTime ());
83
84 _console.Format( _T ("It takes %dmsec.\n"), msec);
85
86 return TRUE;
87}
#define CONFIG_FILE
Definition: ConsoleDriver.h:10
プリミティブな変数を管理するコンテナクラス
#define size
std::vector<T>性能測定用
プリコンパイル済みヘッダー ファイルです。
virtual BOOL Core(const int param1, const int param2)
コンソールに関するクラス
Definition: Console.h:88
VOID APIENTRY Format(LPCTSTR format,...) const
コンソールに文字を出力します。
Definition: Console.cpp:63
高分解能時間計測クラス
VOID APIENTRY Start()
計測を開始します。
double APIENTRY PastTime() const
計測開始〜計測終了までの時間を出力します。
VOID APIENTRY Stop()
計測を終了します。
static BOOL APIENTRY ReadIniFile(LPCTSTR lpctszIniFile, LPCTSTR lpctszSection, LPCTSTR lpctszKeyword, TString &response)
設定フィルの読み込み
Definition: Utility.cpp:178
プリミティブな変数を管理するコンテナクラス
Definition: Freight.hpp:18