1 def applyDelegate(delegate
as System
.Delegate
, iterator
):
3 delegate
.DynamicInvoke((item
,))
5 def applyCallable(fn
as ICallable
, iterator
):
9 def timeit(name
, fn
as ICallable
):
11 fn(foo
, range(5000000))
12 print("${name} took ${date.Now-start}")
17 timeit("Delegate.DynamicInvoke", applyDelegate
)
18 timeit("ICallable.Call", applyCallable
)