From 631a152b8ea535925f18066f3d973bdf3bcafd35 Mon Sep 17 00:00:00 2001 From: wirawan Date: Mon, 27 Sep 2010 19:41:15 +0000 Subject: [PATCH] * Moving pyqmc.utils.timer to wpylib. --- timer.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 timer.py diff --git a/timer.py b/timer.py new file mode 100644 index 0000000..766ea96 --- /dev/null +++ b/timer.py @@ -0,0 +1,20 @@ +# $Id: timer.py,v 1.1 2010-09-27 19:41:15 wirawan Exp $ +# +# timer.py +# Simple timer and possibly other timing-related routine +# +# Wirawan Purwanto +# Created: 20081022 +# +import time + +class timer: + '''A small timer class.''' + def start(self): + self.tm1 = time.clock() + def stop(self): + self.tm2 = time.clock() + return (self.tm2 - self.tm1) + def length(self): + return self.tm2 - self.tm1 +