test counter utils

This commit is contained in:
rowanc1
2014-05-18 00:15:00 -07:00
parent 709927a574
commit 2392b7d6b9
3 changed files with 56 additions and 19 deletions
+36
View File
@@ -51,3 +51,39 @@ Interpolation Utilities
:members:
:undoc-members:
Counter Utilities
=======================
::
class MyClass(object):
def __init__(self, url):
self.counter = Counter()
@count
def MyMethod(self):
pass
@timeIt
def MySecondMethod(self):
pass
c = MyClass('blah')
for i in range(100): c.MyMethod()
for i in range(300): c.MySecondMethod()
c.counter.summary()
::
Counters:
MyClass.MyMethod : 100
Times: mean sum
MyClass.MySecondMethod : 1.70e-06, 5.10e-04, 300x
The API
-------
.. automodule:: SimPEG.Utils.CounterUtils
:members:
:undoc-members: