summaryrefslogtreecommitdiff
path: root/perf/python/remote_lat.py
diff options
context:
space:
mode:
Diffstat (limited to 'perf/python/remote_lat.py')
-rw-r--r--perf/python/remote_lat.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/perf/python/remote_lat.py b/perf/python/remote_lat.py
index f2ee04a..29bd550 100644
--- a/perf/python/remote_lat.py
+++ b/perf/python/remote_lat.py
@@ -18,7 +18,7 @@
#
import sys
-from datetime import datetime
+import time
import libpyzmq
def main ():
@@ -40,16 +40,17 @@ def main ():
msg = ''.join ([' ' for n in range (0, message_size)])
- start = datetime.now ()
+ start = time.clock ()
for i in range (0, roundtrip_count):
s.send (msg)
msg = s.recv ()
assert len (msg) == message_size
- end = datetime.now ()
- delta = (end - start).microseconds + 1000000 * (end - start).seconds
- latency = float (delta) / roundtrip_count / 2
+ end = time.clock ()
+
+ elapsed = (end - start) * 1000000
+ latency = elapsed / roundtrip_count / 2
print "message size: %.0f [B]" % (message_size, )
print "roundtrip count: %.0f" % (roundtrip_count, )