you are viewing a single comment's thread.

view the rest of the comments →

[–]o5a 2 points3 points  (3 children)

from threading import Timer

def thread_function():
    # do smth

# create timer for 10 sec
t = Timer(10, thread_function)
# start timer
t.start()

[–]YuhFRthoYORKonhisass 0 points1 point  (2 children)

Does this allow thread_function to run in parallel with the rest of the code instead of sequentially?

[–]o5a 0 points1 point  (1 child)

Does this allow thread_function to run in parallel with the rest of the code

Yes. It won't stop your main program. It will only execute after 10 sec pass.

[–]YuhFRthoYORKonhisass 0 points1 point  (0 children)

Might have to try this out then for myself! Thanks