TODO Make both solutions compatible with Python3 Timeout Make the solution thread safe allow timeout for fractional seconds Fixed Frequency Allow this solution to work with multiple threads