I am trying to write a thread that will execute a function every 2 seconds until the program is close, in which case it will stop. I can write the program easy enough to execute the command every 2 seconds, the problem comes when I try to close the program. It won't close the thread. Any ideas as to what I can do? Thanks!