Issue #17 introduced the TimeTasks class to implement basic profiling.
A simpler and more general approach is possible based on macros and automatic destructors.
Create a set of time_task macros to be used as follows:
void mymethod()
{
// record time from this point to the end of this scope.
timeTasks_set_main_task(Task::PARTICLES);
...
// block that does communication
{
// mode is reset to communication until end of scope
timeTasks_set_communicating();
...
}
}
Improvements:
use of destructors: The implementation of the time_task macros constructs a non-anonymous class instance whose destructor is called when it goes out of scope. This eliminates the need to make separate calls to start() and end() methods.
Issue #17 introduced the TimeTasks class to implement basic profiling.
A simpler and more general approach is possible based on macros and automatic destructors.
Create a set of time_task macros to be used as follows:
Improvements:
start()
andend()
methods.