Skip to content

check_clock

Part of Reusable workflows in the Python API reference.

Related guidance: shipped-tooling.

Runnable examples: check_clock.py.

from picogrid_ecn_client.workflows import check_clock

Measure ECN-relative clock offset and optionally enforce a maximum offset.

async def check_clock(
client: ECNClient,
*,
samples: int = 3,
timeout: float | None = None,
max_offset_seconds: float | None = None,
) -> CheckClockResult
NameTypeDefaultDescription
clientECNClientConfigured SDK client whose clock endpoint will be queried.
samplesint3Number of valid NTP samples to collect.
timeoutfloat | NoneNoneOptional total measurement timeout in seconds.
max_offset_secondsfloat | NoneNoneOptional maximum permitted absolute offset in seconds.
TypeDescription
CheckClockResultThe typed clock measurement result.
ExceptionDescription
ClockErrorIf the measurement fails.
ClockToleranceErrorIf max_offset_seconds is exceeded.
ValidationErrorIf a numeric argument is outside its supported range.

Source · workflows/diagnostics.py

Version 0.2.0 · branch main