10 #include "Teuchos_CTimeMonitor.h"
12 #include "Teuchos_implicit_cast.hpp"
13 #include "Teuchos_StandardCatchMacros.hpp"
14 #include "Teuchos_VerboseObject.hpp"
15 #include "Teuchos_CompilerCodeTweakMacros.hpp"
22 TimerArray_t timerArray;
28 int Teuchos_startTimer(
char timerName[],
int timerID )
36 timerArray.back()->start();
37 return timerArray.size()-1;
41 timerID >= implicit_cast<int>(timerArray.size()), std::logic_error,
42 "Teuchos_startTimer(...): Error, timerID="<<timerID
43 <<
" is >= timerArray.size()="<<timerArray.size()
44 <<
" for timerName=\""<<timerName<<
"\"!"
48 timer->isRunning(), std::logic_error,
49 "Teuchos_startTimer(...): Error, timerID="<<timerID
50 <<
", timerName=\""<<timerName<<
"\" is already running!"
63 void Teuchos_stopTimer(
int timerID )
69 timerID < 0 || timerID >= implicit_cast<int>(timerArray.size()),
71 "Teuchos_stopTimer(...): Error, timerID="<<timerID<<
" is invalid!"
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
double stop()
Stop the timer, if the timer is enabled (see disable()).
static RCP< FancyOStream > getDefaultOStream()
Get the default output stream object.
TypeTo implicit_cast(const TypeFrom &t)
Perform an implicit cast of concrete types with the casted object returned by value.
Scope guard for Teuchos::Time, with MPI collective timer reporting.
Smart reference counting pointer class for automatic garbage collection.
#define TEUCHOS_STANDARD_CATCH_STATEMENTS(VERBOSE, ERR_STREAM, SUCCESS_FLAG)
Simple macro that catches and reports standard exceptions and other exceptions.
void incrementNumCalls()
Increment the number of times this timer has been called, if the timer is enabled (see disable())...
Replacement for std::vector that is compatible with the Teuchos Memory Management classes...