diff options
author | Joe Anderson <jandew+dev@gmail.com> | 2011-11-01 12:11:24 -0500 |
---|---|---|
committer | Joe Anderson <jandew+dev@gmail.com> | 2011-11-01 12:11:24 -0500 |
commit | 66d60af7c93dbbada811b20c5979f1d64fb53900 (patch) | |
tree | c66b8cb4993985bda99d1e6502cbcc20e91245a1 /throw.py | |
parent | 7c287638c316b285b3dbcdaf56c650164828a42c (diff) | |
download | toss-66d60af7c93dbbada811b20c5979f1d64fb53900.tar.gz toss-66d60af7c93dbbada811b20c5979f1d64fb53900.zip |
added heirarchical timing
Diffstat (limited to 'throw.py')
-rw-r--r-- | throw.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -120,7 +120,7 @@ def solve_fun(func, init_vars, timespace): time0 = current_time() time = numpy.linspace(*timespace) soln = odeint(func, init_vars, time) - print "took %s seconds to solve" % (current_time() - time0) + print " :: took %s seconds" % (current_time() - time0) return time, soln TimespaceTooSmall = Warning(" *** Requires larger timespace!!! *** ") @@ -145,6 +145,7 @@ def interpret(soln, max_tension): def solver(func, init_vars, timespace=(0,600,10**5), max_tension=max_tension, returns=['time', 'variables', 'slices', 'maxes']): + time0 = current_time() for n in itertools.count(1): time, soln = solve_fun(func, init_vars, timespace) @@ -159,6 +160,8 @@ def solver(func, init_vars, timespace=(0,600,10**5), max_tension=max_tension, slices = map(getslice, (time,) + variables) maxes = map(getmax, (time,) + variables) + print ": took %s seconds to solve" % (current_time() - time0) + out = [] for item in returns: out.append(vars()[item]) return tuple(out) |