I would like to have a thread running in background which will check connection to some server with given time interval. For example for every 5 seconds.
If the thread runs for the life of the app, can be simply terminated by the OS on app close and does not need accurate timing, why bother with solutions that require more typing than sleep(5000)?