Skip to content

Commit

Permalink
Correct bench timing
Browse files Browse the repository at this point in the history
No functional change.
  • Loading branch information
oskmeister authored and lucasart committed Aug 1, 2014
1 parent 5adc678 commit 29451de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/benchmark.cpp
Expand Up @@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <algorithm>
#include <fstream>
#include <iostream>
#include <istream>
Expand Down Expand Up @@ -161,7 +162,7 @@ void benchmark(const Position& current, istream& is) {
}
}

elapsed = Time::now() - elapsed + 1; // Ensure positivity to avoid a 'divide by zero'
elapsed = std::max(Time::now() - elapsed, Time::point(1)); // Avoid a 'divide by zero'

dbg_print(); // Just before to exit

Expand Down

0 comments on commit 29451de

Please sign in to comment.