bin/receive_text: print elapsed time

This commit is contained in:
Brian Warner 2015-02-11 01:45:54 -08:00
parent 48476f0840
commit d4233f44df

View File

@ -1,13 +1,15 @@
from __future__ import print_function from __future__ import print_function
import sys, json import time, sys, json
from wormhole.transcribe import Receiver from wormhole.transcribe import Receiver
APPID = "lothar.com/wormhole/text-xfer" APPID = "lothar.com/wormhole/text-xfer"
# we're receiving # we're receiving
start = time.time()
code = sys.argv[1] code = sys.argv[1]
blob = b"{}" blob = b"{}"
r = Receiver(APPID, blob, code) r = Receiver(APPID, blob, code)
them_bytes = r.get_data() them_bytes = r.get_data()
them_d = json.loads(them_bytes.decode("utf-8")) them_d = json.loads(them_bytes.decode("utf-8"))
print(them_d["message"]) print(them_d["message"])
print("elapsed time: %.2f" % (time.time() - start))