I have a set of data like
schedule = [(2, 5),
(4, 6),
(10, 2)]
with the first element of each tuple being a time (in seconds) and the second element being a value.
I would like to start a separate thread which tracks the time and at each scheduled time runs some arbitrary function func(value).
What is the cleanest way to do this? I could create a Timer object for each scheduled time, but that seems sloppy.
edit: You can assume the times are in ascending order