#include <IpTimedTask.hpp>
Public Member Functions | |
void | Reset () |
Method for resetting time to zero. | |
void | Start () |
Method that is called before execution of the task. | |
void | End () |
Method that is called after execution of the task. | |
void | EndIfStarted () |
Method that is called after execution of the task for which timing might have been started. | |
Number | TotalTime () const |
Method returning total time spend for task so far. | |
Constructors/Destructors | |
TimedTask () | |
Default constructor. | |
~TimedTask () | |
Default destructor. | |
Static Public Member Functions | |
static Number | CpuTime () |
method determining CPU executed since start of program | |
Private Member Functions | |
Default Compiler Generated Methods (Hidden to avoid | |
implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
TimedTask (const TimedTask &) | |
Copy Constructor. | |
void | operator= (const TimedTask &) |
Overloaded Equals Operator. | |
Private Attributes | |
Number | start_time_ |
Time at beginning of task. | |
Number | total_time_ |
Total time for task measured so far. | |
fields for debugging | |
bool | start_called_ |
bool | end_called_ |
Definition at line 41 of file IpTimedTask.hpp.
Ipopt::TimedTask::TimedTask | ( | ) | [inline] |
Ipopt::TimedTask::~TimedTask | ( | ) | [inline] |
Ipopt::TimedTask::TimedTask | ( | const TimedTask & | ) | [private] |
Copy Constructor.
void Ipopt::TimedTask::Reset | ( | ) | [inline] |
Method for resetting time to zero.
Definition at line 60 of file IpTimedTask.hpp.
References end_called_, start_called_, and total_time_.
void Ipopt::TimedTask::Start | ( | ) | [inline] |
Method that is called before execution of the task.
Definition at line 68 of file IpTimedTask.hpp.
References CpuTime(), DBG_ASSERT, end_called_, start_called_, and start_time_.
void Ipopt::TimedTask::End | ( | ) | [inline] |
Method that is called after execution of the task.
Definition at line 78 of file IpTimedTask.hpp.
References CpuTime(), DBG_ASSERT, end_called_, start_called_, start_time_, and total_time_.
void Ipopt::TimedTask::EndIfStarted | ( | ) | [inline] |
Method that is called after execution of the task for which timing might have been started.
This only updates the timing if the timing has indeed been conducted. This is useful to stop timing after catching exceptions.
Definition at line 91 of file IpTimedTask.hpp.
References CpuTime(), DBG_ASSERT, end_called_, start_called_, start_time_, and total_time_.
Number Ipopt::TimedTask::TotalTime | ( | ) | const [inline] |
Method returning total time spend for task so far.
Definition at line 102 of file IpTimedTask.hpp.
References DBG_ASSERT, end_called_, and total_time_.
static Number Ipopt::TimedTask::CpuTime | ( | ) | [inline, static] |
method determining CPU executed since start of program
Definition at line 110 of file IpTimedTask.hpp.
Referenced by End(), EndIfStarted(), and Start().
void Ipopt::TimedTask::operator= | ( | const TimedTask & | ) | [private] |
Overloaded Equals Operator.
Number Ipopt::TimedTask::start_time_ [private] |
Time at beginning of task.
Definition at line 147 of file IpTimedTask.hpp.
Referenced by End(), EndIfStarted(), and Start().
Number Ipopt::TimedTask::total_time_ [private] |
Total time for task measured so far.
Definition at line 149 of file IpTimedTask.hpp.
Referenced by End(), EndIfStarted(), Reset(), and TotalTime().
bool Ipopt::TimedTask::start_called_ [private] |
Definition at line 153 of file IpTimedTask.hpp.
Referenced by End(), EndIfStarted(), Reset(), and Start().
bool Ipopt::TimedTask::end_called_ [private] |
Definition at line 154 of file IpTimedTask.hpp.
Referenced by End(), EndIfStarted(), Reset(), Start(), and TotalTime().