:param times: How many times to retry the function.
While in reality:
if isinstance(times, Timer):
stopper = times # a timer is a valid stopper
elif isinstance(times, Duration):
stopper = Timer(expiration=times)
elif isinstance(times, int):
stopper = ExpiringCounter(times)
:param times: How many times to retry the function.
While in reality: