|
20 | 20 | * - License: MIT |
21 | 21 | */ |
22 | 22 |
|
23 | | -#include "../src/vmaware.hpp" |
| 23 | +#include "vmaware.hpp" |
24 | 24 | #include <iostream> |
25 | 25 | #include <string> |
26 | 26 | #include <cmath> |
|
35 | 35 |
|
36 | 36 | const std::string bold = "\033[1m"; |
37 | 37 | const std::string ansi_exit = "\x1B[0m"; |
38 | | -const std::string red = "\x1B[38;2;239;75;75m"; |
| 38 | +const std::string red = "\x1B[38;2;239;75;75m"; |
39 | 39 | const std::string green = "\x1B[38;2;94;214;114m"; |
40 | 40 | const std::string orange = "\x1B[38;2;255;180;5m"; |
41 | 41 |
|
@@ -103,34 +103,6 @@ int main(void) { |
103 | 103 | std::string vm_brand, vm_type; |
104 | 104 | uint8_t vm_percent; |
105 | 105 |
|
106 | | - /* ================================================ NO MEMOIZATION CATEGORY ================================================ */ |
107 | | - |
108 | | - // VMAwareBenchmark VM::detect(VM::NO_MEMO) |
109 | | - start = VMAwareBenchmark::get_timestamp(); |
110 | | - is_detected = VM::detect(VM::NO_MEMO); |
111 | | - end = VMAwareBenchmark::get_timestamp(); |
112 | | - const double detect_time_no_memo = VMAwareBenchmark::get_elapsed(start, end); |
113 | | - |
114 | | - // VMAwareBenchmark VM::brand() |
115 | | - start = VMAwareBenchmark::get_timestamp(); |
116 | | - vm_brand = VM::brand(VM::NO_MEMO); |
117 | | - end = VMAwareBenchmark::get_timestamp(); |
118 | | - const double brand_time_no_memo = VMAwareBenchmark::get_elapsed(start, end); |
119 | | - |
120 | | - // VMAwareBenchmark VM::type() |
121 | | - start = VMAwareBenchmark::get_timestamp(); |
122 | | - vm_type = VM::type(VM::NO_MEMO); |
123 | | - end = VMAwareBenchmark::get_timestamp(); |
124 | | - const double type_time_no_memo = VMAwareBenchmark::get_elapsed(start, end); |
125 | | - |
126 | | - // VMAwareBenchmark VM::percentage() |
127 | | - start = VMAwareBenchmark::get_timestamp(); |
128 | | - vm_percent = VM::percentage(VM::NO_MEMO); |
129 | | - end = VMAwareBenchmark::get_timestamp(); |
130 | | - const double percent_time_no_memo = VMAwareBenchmark::get_elapsed(start, end); |
131 | | - |
132 | | - /* ================================================ DEFAULT CATEGORY ================================================ */ |
133 | | - |
134 | 106 | // VMAwareBenchmark VM::detect() |
135 | 107 | start = VMAwareBenchmark::get_timestamp(); |
136 | 108 | is_detected = VM::detect(); |
@@ -165,25 +137,21 @@ int main(void) { |
165 | 137 | << "VM::brand(): " << VMAwareBenchmark::format_duration(brand_time) << "\n" |
166 | 138 | << "VM::type(): " << VMAwareBenchmark::format_duration(type_time) << "\n" |
167 | 139 | << "VM::percentage(): " << VMAwareBenchmark::format_duration(percent_time) << "\n\n" |
168 | | - << "Benchmark Results (not cached):\n" |
169 | | - << "VM::detect(VM::NO_MEMO): " << VMAwareBenchmark::format_duration(detect_time_no_memo) << "\n" |
170 | | - << "VM::brand(VM::NO_MEMO): " << VMAwareBenchmark::format_duration(brand_time_no_memo) << "\n" |
171 | | - << "VM::type(VM::NO_MEMO): " << VMAwareBenchmark::format_duration(type_time_no_memo) << "\n" |
172 | | - << "VM::percentage(VM::NO_MEMO): " << VMAwareBenchmark::format_duration(percent_time_no_memo) << "\n\n"; |
| 140 | + << "Benchmark Results (not cached):\n"; |
173 | 141 |
|
174 | 142 | for (const VM::enum_flags technique_enum : VM::technique_vector) { |
175 | 143 | start = VMAwareBenchmark::get_timestamp(); |
176 | 144 |
|
177 | | - VM::check(technique_enum, VM::NO_MEMO); |
| 145 | + VM::check(technique_enum); |
178 | 146 |
|
179 | 147 | end = VMAwareBenchmark::get_timestamp(); |
180 | 148 | const double technique_time = VMAwareBenchmark::get_elapsed(start, end); |
181 | | - |
182 | | - std::cout << |
183 | | - "VM::" << |
184 | | - VM::flag_to_string(technique_enum) << |
185 | | - ": " << |
186 | | - VMAwareBenchmark::format_duration(technique_time) << |
| 149 | + |
| 150 | + std::cout << |
| 151 | + "VM::" << |
| 152 | + VM::flag_to_string(technique_enum) << |
| 153 | + ": " << |
| 154 | + VMAwareBenchmark::format_duration(technique_time) << |
187 | 155 | "\n"; |
188 | 156 | } |
189 | 157 |
|
|
0 commit comments