Method Calculate
Calculate(ulong, DateTime, double)
Calculates the rate using provided newCounter against previous counters buffered in this Rate64OnDateTime instance.
public double Calculate(ulong newCounter, DateTime utcDateTime, double faultyReturn = -1)
Parameters
newCounterulongThe latest known counter value.
utcDateTimeDateTimeThe DateTime at which
newCountervalue was taken.
Note that the use of UTC Time is required to avoid issues when daylight saving time changes occur.faultyReturndoubleThe value to be returned in case a correct rate could not be calculated.
Returns
- double
The calculated rate or the value specified in
faultyReturnin case the rate can not be calculated.
Exceptions
- ArgumentException
utcDateTimeis not of kind Utc