Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 4829dd23 authored by Dos Santos David's avatar Dos Santos David

add util function to time functions

parent 072f7c96
import time
def timeit(text):
def timeit_decorator(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
print('... {name} {time:2.2f} ms\n'.format(name=text,time=(te-ts)*1000))
return result
return timed
return timeit_decorator
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment