diff options
| author | Austin Hellyer <[email protected]> | 2017-01-16 10:19:21 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-01-16 10:19:21 -0800 |
| commit | 0909b0b55c063b017c1f9ed126dff20ac9ccd56b (patch) | |
| tree | cd4d2fbc578a991139593715dfb85dd949c0ac82 /src/client | |
| parent | Set internal seq to number received on dispatches (diff) | |
| download | serenity-0909b0b55c063b017c1f9ed126dff20ac9ccd56b.tar.xz serenity-0909b0b55c063b017c1f9ed126dff20ac9ccd56b.zip | |
Credit Shard::latency
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/gateway/shard.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client/gateway/shard.rs b/src/client/gateway/shard.rs index bd0fb50..49dbe14 100644 --- a/src/client/gateway/shard.rs +++ b/src/client/gateway/shard.rs @@ -453,6 +453,8 @@ impl Shard { /// Calculates the heartbeat latency (in nanoseconds) between the shard and /// Discord. + // Shamelessly stolen from brayzure's commit in eris: + // <https://github.com/abalabahaha/eris/commit/0ce296ae9a542bcec0edf1c999ee2d9986bed5a6> pub fn latency(&self) -> Option<StdDuration> { self.heartbeat_instants.1.map(|send| send - *self.heartbeat_instants.0.lock().unwrap()) } |