标签:pytho pre maxscript 装饰器 for imei tar time code
fn timeit func =
(
global tmp_func = func
fn warpper =
(
start_time = timeStamp()
tmp_func()
end_time = timeStamp()
print ("用时:" + (end_time - start_time) as string + "ms")
)
return warpper
)
fn foo =
(
for i = 1 to 5 do sleep 0.01
)
foo = timeit foo
foo()
timeit()
foo()
warpper()
"用时:55ms"
"用时:55ms"
标签:pytho pre maxscript 装饰器 for imei tar time code
原文地址:https://www.cnblogs.com/trykle/p/11438034.html