Is there any way to get a delay in a function

i know i can cast but i cant get the refrence for the widget with get all widgets of class