File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -175,20 +175,17 @@ auto sourcemeta::jsonschema::cli::validate(
175
175
bool subresult{true };
176
176
if (benchmark) {
177
177
double sum = 0.0 , sum2 = 0.0 , empty = 0.0 ;
178
- size_t count = 0 ;
179
178
180
179
// overhead evaluation, if the compiler is kind enough not to optimize
181
180
// this out!
182
181
for (auto i = bench_loop; i; i--) {
183
182
const auto start{std::chrono::high_resolution_clock::now ()};
184
- count++;
185
183
const auto end{std::chrono::high_resolution_clock::now ()};
186
184
empty +=
187
- (double )(std::chrono::duration_cast<std::chrono::microseconds >(
185
+ (double )(std::chrono::duration_cast<std::chrono::nanoseconds >(
188
186
end - start))
189
- .count ();
187
+ .count () / 1000.0 ;
190
188
}
191
- assert (count == bench_loop);
192
189
empty /= (double )bench_loop;
193
190
194
191
// execution time evaluation
@@ -200,9 +197,9 @@ auto sourcemeta::jsonschema::cli::validate(
200
197
201
198
const auto end{std::chrono::high_resolution_clock::now ()};
202
199
const auto delay =
203
- (double )(std::chrono::duration_cast<std::chrono::microseconds >(
200
+ (double )(std::chrono::duration_cast<std::chrono::nanoseconds >(
204
201
end - start))
205
- .count () -
202
+ .count () / 1000.0 -
206
203
empty;
207
204
208
205
sum += delay;
You can’t perform that action at this time.
0 commit comments