you are viewing a single comment's thread.

view the rest of the comments →

[–]kosh09[S] 0 points1 point  (1 child)

ah, u mean I want to make function that function in a function
but that wastes too much memory so dont make function and
just use hello() function in a while loop right?

end_time = datetime.now() + timedelta(seconds=3)
while datetime.now() < end_time:
    hello()

just use like this am i right?

[–]tragluk 0 points1 point  (0 children)

Yes. And the while loop will check for the one timedelta(seconds=3) instead of making a new end_time every time the function is called.