Skip to content
This repository was archived by the owner on Aug 12, 2023. It is now read-only.

Commit f45608c

Browse files
committed
Minor improvements.
1 parent b0cfc64 commit f45608c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ClassFromRTTI/ClassFromRTTI.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ int main() {
4343
high_resolution_clock::time_point t2;
4444

4545
// Stage 1
46+
printf("# Stage 1\n");
4647
t1 = high_resolution_clock::now();
4748
for (unsigned char i = 0; i < 100; ++i) {
4849
if (unTestingRVA != cRTTI1.GetVTableOffsetFromModule(hTestDLL, "TestingDLL")) {
@@ -80,6 +81,7 @@ int main() {
8081
printf("Bench (50 000 calls)............................= %lld ms\n", duration_cast<std::chrono::milliseconds>(t2 - t1).count());
8182

8283
// Stage 2
84+
printf("# Stage 2\n");
8385
t1 = high_resolution_clock::now();
8486
for (unsigned char i = 0; i < 100; ++i) {
8587
if (unTestingRVA != cRTTI2.GetVTableOffsetFromModule(hTestDLL, "TestingDLL")) {
@@ -117,6 +119,7 @@ int main() {
117119
printf("Bench (50 000 calls + Cache)....................= %lld ms\n", duration_cast<std::chrono::milliseconds>(t2 - t1).count());
118120

119121
// Stage 3
122+
printf("# Stage 3\n");
120123
t1 = high_resolution_clock::now();
121124
for (unsigned char i = 0; i < 100; ++i) {
122125
if (unTestingRVA != cRTTI3.GetVTableOffsetFromModule(hTestDLL, "TestingDLL")) {
@@ -154,6 +157,7 @@ int main() {
154157
printf("Bench (50 000 calls + MinIterations)............= %lld ms\n", duration_cast<std::chrono::milliseconds>(t2 - t1).count());
155158

156159
// Stage 4
160+
printf("# Stage 4\n");
157161
t1 = high_resolution_clock::now();
158162
for (unsigned char i = 0; i < 100; ++i) {
159163
if (unTestingRVA != cRTTI4.GetVTableOffsetFromModule(hTestDLL, "TestingDLL")) {
@@ -189,7 +193,6 @@ int main() {
189193
}
190194
t2 = high_resolution_clock::now();
191195
printf("Bench (50 000 calls + Cache + MinIterations)....= %lld ms\n", duration_cast<std::chrono::milliseconds>(t2 - t1).count());
192-
193196
#endif // BENCHMARK_TEST
194197

195198
if (!unTestingRVA) {
@@ -202,6 +205,7 @@ int main() {
202205
fnIsTrue IsTrue = reinterpret_cast<fnIsTrue>(pTestingDLL_VT[0]);
203206
fnHelloWorld HelloWorld = reinterpret_cast<fnHelloWorld>(pTestingDLL_VT[1]);
204207

208+
printf("# Result:\n");
205209
printf("IsTrue = %s\n", IsTrue(pTestingDLL_VT, nullptr) ? "true" : "false");
206210
printf("HelloWorld = %s\n", HelloWorld(pTestingDLL_VT, nullptr));
207211

0 commit comments

Comments
 (0)