Merge branch 'aholen-master'
This commit is contained in:
@@ -58,6 +58,8 @@ def parse_args():
|
|||||||
help="wait time(second) after 'EOF' recieved.")
|
help="wait time(second) after 'EOF' recieved.")
|
||||||
parser.add_argument("-t", "--text",
|
parser.add_argument("-t", "--text",
|
||||||
help="Send initial text")
|
help="Send initial text")
|
||||||
|
parser.add_argument("--timings", action="store_true",
|
||||||
|
help="Print timings in seconds")
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
@@ -96,6 +98,7 @@ class NonInteractive(RawInput):
|
|||||||
return self.raw_input("")
|
return self.raw_input("")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
start_time = time.time()
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
if args.verbose > 1:
|
if args.verbose > 1:
|
||||||
websocket.enableTrace(True)
|
websocket.enableTrace(True)
|
||||||
@@ -149,6 +152,9 @@ def main():
|
|||||||
msg = "%s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data)
|
msg = "%s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data)
|
||||||
|
|
||||||
if msg is not None:
|
if msg is not None:
|
||||||
|
if (args.timings):
|
||||||
|
console.write(str(time.time() - start_time) + ": " + msg)
|
||||||
|
else:
|
||||||
console.write(msg)
|
console.write(msg)
|
||||||
|
|
||||||
if opcode == websocket.ABNF.OPCODE_CLOSE:
|
if opcode == websocket.ABNF.OPCODE_CLOSE:
|
||||||
|
Reference in New Issue
Block a user