Added new timing helper in python

This commit is contained in:
Guilhem Lavaux 2014-07-28 09:33:08 +02:00
parent 6150597c67
commit 917a45b494
3 changed files with 17 additions and 1 deletions

View File

@ -4,4 +4,4 @@ from grafic import writeGrafic, writeWhitePhase, readGrafic, readWhitePhase
from borg import read_borg_vol from borg import read_borg_vol
from cic import cicParticles from cic import cicParticles
from simu import loadRamsesAll, simpleWriteGadget, SimulationBare from simu import loadRamsesAll, simpleWriteGadget, SimulationBare
from timing import timeit, timeit_quiet from timing import time_block, timeit, timeit_quiet

View File

@ -1,4 +1,14 @@
import time import time
from contextlib import contextmanager
@contextmanager
def time_block(name):
ts = time.time()
yield
te = time.time()
print '%s %2.2f sec' % \
(name, te-ts)
def timeit(method): def timeit(method):

View File

@ -135,6 +135,12 @@ namespace CosmoTool
int Nx, Ny, Nz; int Nx, Ny, Nz;
}; };
template<typename IType, typename ArrayType>
void singleInterpolation(IType *input_array, ArrayType *x, ArrayType *y, ArrayType *z, ArrayType *scalers)
{
}
}; };
#endif #endif