From 0bd54d38218f0282730b3afd56231a26388b105f Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 30 Nov 2001 11:56:35 +0000 Subject: [PATCH] Added optional code to time how long the test takes. [SVN r11828] --- test/regress/regress.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/regress/regress.cpp b/test/regress/regress.cpp index 913eafa6..2bcddc7b 100644 --- a/test/regress/regress.cpp +++ b/test/regress/regress.cpp @@ -46,6 +46,9 @@ using std::endl; #if defined(BOOST_MSVC) && defined(_DEBUG) #include #endif +#ifdef TIME_TEST +#include +#endif // @@ -82,6 +85,9 @@ int cpp_main(int argc, char * argv[]) tmpFlag |= _CRTDBG_LEAK_CHECK_DF; tmpFlag &= ~_CRTDBG_CHECK_CRT_DF; _CrtSetDbgFlag( tmpFlag ); +#endif +#ifdef TIME_TEST + boost::timer tim; #endif if(argc < 2) usage(); @@ -113,6 +119,10 @@ int cpp_main(int argc, char * argv[]) } cout << line << " lines, " << tests << " tests completed in file " << argv[i] << endl; } +#ifdef TIME_TEST + double elapsed_time = tim.elapsed(); + cout << "Elapsed time = " << elapsed_time << "s" << endl; +#endif return error_count; }