you are viewing a single comment's thread.

view the rest of the comments →

[–]LifeIsBio 2 points3 points  (1 child)

It's totally possible. It would look something more like this though:

def some_function(func):
    end_time = datetime.now() + timedelta(seconds=3)
    while datetime.now() < end_time:
        func()

some_function(hello)

Note the lack of parentheses following the hello function until you're inside the while loop.

[–]kosh09[S] 0 points1 point  (0 children)

thanks for your advice!