aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-16 10:19:21 -0800
committerAustin Hellyer <[email protected]>2017-01-16 10:19:21 -0800
commit0909b0b55c063b017c1f9ed126dff20ac9ccd56b (patch)
treecd4d2fbc578a991139593715dfb85dd949c0ac82 /src/client
parentSet internal seq to number received on dispatches (diff)
downloadserenity-0909b0b55c063b017c1f9ed126dff20ac9ccd56b.tar.xz
serenity-0909b0b55c063b017c1f9ed126dff20ac9ccd56b.zip
Credit Shard::latency
Diffstat (limited to 'src/client')
-rw-r--r--src/client/gateway/shard.rs2
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())
}