Added new timing helper in python
This commit is contained in:
parent
6150597c67
commit
917a45b494
@ -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
|
||||||
|
@ -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):
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user