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