Skip to content

Commit 7fb8624

Browse files
committed
Use monotonic timings for A2A_PING
1 parent 8de5e27 commit 7fb8624

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

valve/source/a2s.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from __future__ import (absolute_import,
55
unicode_literals, print_function, division)
66

7-
import time
7+
import monotonic
88

99
import valve.source
1010
from . import messages
@@ -64,10 +64,11 @@ def ping(self):
6464
be negligble.
6565
"""
6666

67-
t_send = time.time()
67+
time_sent = monontic.monotonic()
6868
self.request(messages.InfoRequest())
6969
messages.InfoResponse.decode(self.get_response())
70-
return (time.time() - t_send) * 1000.0
70+
time_received = monotonic.monotonic()
71+
return (time_received - t_sent) * 1000.0
7172

7273
def info(self):
7374
"""Retreive information about the server state

0 commit comments

Comments
 (0)