From d38cdb9b8c432e179fcb5b073cabb53e3a90e583 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Fri, 2 May 2014 10:27:57 +0800 Subject: [PATCH] add latency test --- test_latency.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test_latency.py diff --git a/test_latency.py b/test_latency.py new file mode 100644 index 0000000..9066e9a --- /dev/null +++ b/test_latency.py @@ -0,0 +1,13 @@ +#!/usr/bin/python + +import sys +import time + + +before = time.time() + +for line in sys.stdin: + if 'HTTP/1.1 ' in line: + diff = time.time() - before + print 'headline %dms' % (diff * 1000) +