ModularM
Modular•17mo ago•
1 reply
samufi🌳

What does the keyword `capturing` do?

I noticed that the keyword capturing is necessary when I want to time code via time_function. For example,
from time import time_function

fn closure() capturing:
    my_function()

print(time_function[closure]() * 1e-9)

What is going on under the hood if I am using the keyword capturing? I have not found documentation on this.
Was this page helpful?