Merge pull request #6265 from jmdavis/benchmark_race

Fix issue with benchmark unit test when compiling with optimizations.
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
This commit is contained in:
The Dlang Bot 2018-03-12 00:24:54 +01:00 committed by GitHub
commit 3b50b5bf69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -447,7 +447,7 @@ Duration[fun.length] benchmark(fun...)(uint n)
void f0() nothrow {}
void f1() nothrow { auto b = to!string(a); }
auto r = benchmark!(f0, f1)(1000);
assert(r[0] > Duration.zero);
assert(r[0] >= Duration.zero);
assert(r[1] > Duration.zero);
assert(r[1] > r[0]);
assert(r[0] < seconds(1));