diff --git a/valve/source/a2s.py b/valve/source/a2s.py index 19914a1..28103eb 100644 --- a/valve/source/a2s.py +++ b/valve/source/a2s.py @@ -4,7 +4,7 @@ from __future__ import (absolute_import, unicode_literals, print_function, division) -import time +import monotonic import valve.source from . import messages @@ -64,10 +64,11 @@ def ping(self): be negligble. """ - t_send = time.time() + time_sent = monontic.monotonic() self.request(messages.InfoRequest()) messages.InfoResponse.decode(self.get_response()) - return (time.time() - t_send) * 1000.0 + time_received = monotonic.monotonic() + return (time_received - t_sent) * 1000.0 def info(self): """Retreive information about the server state