Rev 738: Add 'time' functionality to the shell functionality. in http://bzr.arbash-meinel.com/plugins/bzrtools
John Arbash Meinel
john at arbash-meinel.com
Thu Dec 17 22:03:54 GMT 2009
At http://bzr.arbash-meinel.com/plugins/bzrtools
------------------------------------------------------------
revno: 738
revision-id: john at arbash-meinel.com-20091217220334-951uf5olpy5pdn66
parent: aaron at aaronbentley.com-20091201032457-ng4w9ssd2uavdf3c
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: bzrtools
timestamp: Thu 2009-12-17 16:03:34 -0600
message:
Add 'time' functionality to the shell functionality.
-------------- next part --------------
=== modified file 'shell.py'
--- a/shell.py 2009-11-16 20:47:28 +0000
+++ b/shell.py 2009-12-17 22:03:34 +0000
@@ -23,6 +23,7 @@
import stat
import string
import sys
+import time
from bzrlib import osutils
from bzrlib.branch import Branch
@@ -168,6 +169,16 @@
def do_help(self, line):
self.default("help "+line)
+ def do_time(self, line):
+ if line:
+ start = time.time()
+ self.default(line)
+ end = time.time()
+ sys.stderr.write("%.3fs\n" % (end - start,))
+ else:
+ # Someone just ran 'time', output the current time
+ sys.stderr.write('%s\n' % (time.asctime(),))
+
def default(self, line):
try:
args = shlex.split(line)
More information about the bazaar-commits
mailing list