|
From: | Roee Bar |
Subject: | Re: [Discuss-gnuradio] Timer |
Date: | Tue, 10 Nov 2015 16:03:16 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 |
Thanks Nathan, that was a great advice. Since I use python, it's very easy when using the 'threading' module: def start_timer(self): self.timer = threading.Timer(seconds, self.callback) # Setup a Timer thread self.timer.start() def callback(): # Do something if timeout def msg_handler(self, msg): self.timers.cancel() # Cancel timer if msg arrived before timeout Roee On 11/10/2015 02:36 PM, West, Nathan
wrote:
Spin off a thread inside your block that counts and calls the appropriate function. Boost bind might help abstract away a specific function. |
[Prev in Thread] | Current Thread | [Next in Thread] |