From b1e79fed99d52dcb20d2d6a9c62522226e957963 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 20 Jun 2009 07:58:05 +0100 Subject: [PATCH] Only on Windows do wait for input at the end of benchmark Under MS Visual C++ debug window always unconditionally closes when program exits, this is bad because we want to read results before. So limit this kludge on Windows only. Original patch by Heinz van Saanen. No functional change. Signed-off-by: Marco Costalba --- src/benchmark.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/benchmark.cpp b/src/benchmark.cpp index 02037689..590299d9 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -144,7 +144,16 @@ void benchmark(const string& commandLine) { break; totalNodes += nodes_searched(); } - cout << "\nProcessing time (ms) " << get_system_time() - startTime - << "\nNodes searched " << totalNodes << "\nPress any key to exit" << endl; + cnt = get_system_time() - startTime; + cout << "\nProcessing time (ms) " << cnt + << "\nNodes searched " << totalNodes + << "\nNodes/second " << (int)(totalNodes/(cnt/1000.0)) + << endl; + + // Under MS Visual C++ debug window always unconditionally closes + // when program exits, this is bad because we want to read results before. + #if (defined(WINDOWS) || defined(WIN32) || defined(WIN64)) + cout << "Press any key to exit" << endl; cin >> fileName; + #endif } -- 2.39.2