From 0bab6e867441c4d9d62b436e0aac48b7dc0096a3 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 31 Jan 2009 06:00:31 -0400 Subject: Added a tools/ subdirectory, with various maintainer related files. --- tools/average | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 tools/average (limited to 'tools/average') diff --git a/tools/average b/tools/average new file mode 100755 index 00000000..0e95c1c5 --- /dev/null +++ b/tools/average @@ -0,0 +1,26 @@ +#!/usr/bin/python + +import getopt +import time +import string +import sys +import os + +count = 10 + +opts, args = getopt.getopt(sys.argv[1:], "n:") +for opt in opts: + if opt[0] == "-n": + count = int(opt[1]) + +length = 0.0 + +i = 0 +while i < count: + begin = time.time() + cmd = '"' + string.join(args, '" "') + '"'; + os.system(cmd) + length += time.time() - begin + i += 1 + +print >> sys.stderr, length / count -- cgit v1.2.3