How to implement thread which periodically checks something using minimal resources?
问题 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. I don't know if there is a good "desing pattern" for this? If I remember corretly, I've read somewehere that sleeping thread in its execute method is not good. But I might be wrong. Also, I could use normal TThread class or OTL threading library. Any ideas? Thanks. 回答1: You could use an event and implement the Execute method of the TThread