mirror of
https://github.com/NGSolve/netgen.git
synced 2025-03-25 07:57:57 +05:00
use functools.wrap for the TimeFuncton wrapper.
This commit is contained in:
parent
8362349bb8
commit
57704bddc7
@ -49,9 +49,11 @@ def Redraw(*args, **kwargs):
|
||||
return _Redraw(*args, **kwargs)
|
||||
|
||||
from pyngcore import Timer
|
||||
from functools import wraps
|
||||
def TimeFunction(func, name=None):
|
||||
name = name or func.__qualname__
|
||||
timer = Timer(name)
|
||||
@wraps(func)
|
||||
def retfunc(*args,**kwargs):
|
||||
with timer:
|
||||
ret = func(*args, **kwargs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user