C++ Reference: class EnabledScopedTimeDistributionUpdater

This documentation is automatically generated.

Helper classes to time a block of code and add the result to a TimeDistribution. Calls StartTimer() on creation and StopTimerAndAddElapsedTime() on destruction.

There are three classes with the same interface:
   * EnabledScopedTimeDistributionUpdater always collects the time stats of the scope in which it is defined. This class is used for stats that are always collected.
   * ScopedTimeDistributionUpdater collects the time stats only when OR_STATS is defined. This symbol should be used for collecting stats in places where the overhead of collecting the stats may hurt the performance of the algorithm.
   * DisabledScopedTimeDistributionUpdater is used to implement ScopedTimeDistributionUpdater when OR_STATS is not defined.
Method
AlsoUpdate

Return type: void

Arguments: TimeDistribution* also_update

Updates another TimeDistribution on destruction. This is useful to split a total time measurement in different categories: EnabledScopedTimeDistributionUpdater timer(&total_timer); ... switch (type) { case TypeA : timer.AlsoUpdate(&typeA_timer); break; case TypeB : timer.AlsoUpdate(&typeB_timer); break; }

EnabledScopedTimeDistributionUpdater

Return type: explicit

Arguments: TimeDistribution* stat

Note that this does not take ownership of the given stat.

~EnabledScopedTimeDistributionUpdater

Send feedback about...