Struct twilight_gateway::Latency
source · pub struct Latency { /* private fields */ }
Expand description
Shard
’s gateway connection latency.
Measures the difference between sending a heartbeat and receiving an acknowledgement, also known as a heartbeat period. Spurious heartbeat acknowledgements are ignored.
May be obtained via Shard::latency
.
Implementations§
source§impl Latency
impl Latency
sourcepub const fn average(&self) -> Option<Duration>
pub const fn average(&self) -> Option<Duration>
Average latency.
For example, a reasonable value for this may be between 10 to 100 milliseconds depending on the network connection and physical location.
Returns None
if no heartbeat periods have been recorded.