C++ Reference: class TimeDistribution

This documentation is automatically generated.

Statistic on the distribution of a sequence of running times. Also provides some facility to measure such time with the CPU cycle counter.

TODO(user): Since we inherit from DistributionStat, we currently store the sum of CPU cycles as a double internally. A better option is to use int64 because with the 53 bits of precision of a double, we will run into an issue if the sum of times reaches 52 days for a 2GHz processor.
Method
AddTimeInCycles

Return type: void

Arguments: double cycles

Adds a time in CPU cycles to this distribution.

AddTimeInSec

Return type: void

Arguments: double seconds

Adds a time in seconds to this distribution.

CyclesToSeconds

Return type: static double

Arguments: double num_cycles

Internaly the TimeDistribution stores CPU cycles (to do a bit less work on each StopTimerAndAddElapsedTime()). Use this function to convert all the statistics of DistributionStat into seconds.

Priority

Return type: int

Time distributions have a high priority to be displayed first.

StartTimer

Return type: inline void

Starts the timer in preparation of a StopTimerAndAddElapsedTime().

StopTimerAndAddElapsedTime

Return type: inline double

Adds the elapsed time since the last StartTimer() to the distribution and returns this time in CPU cycles.

TimeDistribution

Return type: explicit

Arguments: const std::string& name

TimeDistribution

Arguments: const std::string& name, StatsGroup* group

ValueAsString

Return type: std::string

Send feedback about...