Skip to main content

AccumulativeAverageNumber

A class in Root.Township, Alta.Networking.

Profiling helper: adds up numbers over one period, then records the total into a running average. EntitySerializer uses two of these for prepare and serialization time.

Constructors​

MemberWhat it is
AccumulativeAverageNumber()Creates an AccumulativeAverageNumber with default values.

Fields​

2 private and internal fields
MemberWhat it is
private AverageNumber durationThe running average the totals are recorded into.
private double sumThe total for the current period.

Properties​

MemberWhat it is
float DurationMs { get; }The running average of the recorded totals, as a float (milliseconds by how it is used).

Methods​

MemberWhat it is
void ClearRecord()Resets the running average.
void RecordAndResetCurrentSum()Adds the current total to the average and starts a new total at zero.
void RecordNumber(double number)Adds a number to the current total.

Used in​

Members of other types that take, return or hold a AccumulativeAverageNumber: