aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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())
}