From f76dedd795c6af9f728f345b08f950853dbf975f Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 8 Apr 2003 18:42:10 +0000 Subject: [PATCH] Fixed verbose logging of command times to only print once for threaded commands. --- src/callbacks.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/callbacks.py b/src/callbacks.py index 01e07623e..c28034f16 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -250,10 +250,7 @@ class IrcObjectProxy: (self.msg.nick, name)) return command = getattr(callback, name) - start = time.time() callback.callCommand(command, self, self.msg, self.args) - elapsed = time.time() - start - debug.msg('%s took %s seconds.' % (name, elapsed), 'verbose') else: self.args.insert(0, name) self.reply(self.msg, '[%s]' % ' '.join(self.args)) @@ -361,7 +358,11 @@ class Privmsg(irclib.IrcCallback): else: # Exceptions aren't caught here because IrcObjectProxy.finalEval # catches them and does The Right Thing. + start = time.time() f(irc, msg, args) + elapsed = time.time() - start + funcname = f.im_func.func_name + debug.msg('%s took %s seconds' % (funcname, elapsed), 'verbose') _r = re.compile(r'^(\w+)') def doPrivmsg(self, irc, msg):