'Initialize a timeout with given duration'

def __init__(self, duration):

    self.is_infinite = (duration is None)
    self.is_non_blocking = (duration == 0)
    self.duration = duration
    if (duration is not None):
        self.target_time = (self.TIME() + duration)
    else:
        self.target_time = None
