ClockModel class final
A straight line through the recent offset estimates for one peer.
Two free-running clocks drift apart at a near-constant rate (tens of ppm), so over a minute the offset is a line, and fitting one gives both a value between estimates and the drift itself. Holds no timers; feed it each accepted ClockOffsetEstimate.
Constructors
- ClockModel({double window = 60, double minSpan = 10})
Properties
- drift → double
-
Drift in seconds per second of the peer's clock.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- minSpan → double
-
Seconds the estimates must span before a slope is fitted. Below it the
drift is reported as zero, since a slope through a few seconds of
millisecond-noisy offsets is noise.
final
- ready → bool
-
Whether any estimate has been accepted. Before that the offset is
unknown, never zero.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uncertainty → double
-
The full round-trip time behind the newest estimate; the offset lies
within ±uncertainty/2.
no setter
- window → double
-
Seconds of estimates the fit runs over, on the peer's clock.
final
Methods
-
add(
ClockOffsetEstimate estimate) → void -
hop(
{required String node, required String via, double? latency, double? jitter, double? held}) → ClockHop - This model as one hop of a ClockChain.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
offsetAt(
double t) → double -
Seconds to add to
ton the peer's clock to get ours. -
reset(
) → void - Forgets everything — the peer's clock domain may have changed.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited