bin/receive_text: print elapsed time
This commit is contained in:
parent
48476f0840
commit
d4233f44df
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user