[Insight-developers] TimeProbe class added : run-time profiling

Luis Ibanez luis.ibanez@kitware.com
Mon, 18 Mar 2002 19:14:26 -0500


Hi

A set of classes for facilitating run-time profiling
has been added under Code/Common.

They are itkTimeProbe and itkTimeProbesCollectorBase.

These classes are intended to help users evaluate the time
used by their program between two points in the code.

An example/test can be found under : Insight/Testing/Code/Common.

FLTK GUI's for them are also available under

    Auxiliary/FltkImageViewer

Here is how it looks:

....
itk::TimeProbesCollectorBase  timeCollector;

...// some code
timeCollector.Start("myTag#1");  // a string is used to associate
                                                  //  the start point 
with the stop
...// more code here

timeCollector.Stop("myTag#1");  // the measure of time is stopped
                                                   //  here for this tag.

timeCollector.Start("anotherTag");
... //more code
timeCollector.Stop("anotherTag");


...// more code here

timeCollector.Report();  // print cumulated times for all the tags.


===

Note that tags can be inside others and do not need to close
one before starting another.



Luis