diff --git a/python_utils/time.py b/python_utils/time.py
index <HASH>..<HASH> 100644
--- a/python_utils/time.py
+++ b/python_utils/time.py
@@ -1,7 +1,12 @@
 import six
+import time
+import typing
 import datetime
+import itertools
 
 
+delta_type = typing.Union[datetime.timedelta, int, float]
+
 # There might be a better way to get the epoch with tzinfo, please create
 # a pull request if you know a better way that functions for Python 2 and 3
 epoch = datetime.datetime(year=1970, month=1, day=1)
@@ -95,3 +100,26 @@ def format_time(timestamp, precision=datetime.timedelta(seconds=1)):
         return '--:--:--'
     else:
         raise TypeError('Unknown type %s: %r' % (type(timestamp), timestamp))
+
+
+def timeout_generator(
+    timeout: delta_type,
+    interval: delta_type = datetime.timedelta(seconds=1),
+    iterable=itertools.count(),
+):
+
+    if isinstance(interval, datetime.timedelta):
+        interval = timedelta_to_seconds(interval)
+
+    if isinstance(timeout, datetime.timedelta):
+        timeout = timedelta_to_seconds(timeout)
+
+    end = timeout + time.perf_counter()
+    for item in iterable:
+        yield item
+
+        if time.perf_counter() >= end:
+            break
+
+        time.sleep(interval)
+
added timeout generator for retrying until a timeout has been reached