def pulse(time, start, duration):
    """
    Implements vensim's PULSE function.

    Parameters
    ----------
    time: function
        Function that returns the current time.
    start: float
        Starting time of the pulse.
    duration: float
        Duration of the pulse.

    Returns
    -------
    float:
        - In range [-inf, start):
            returns 0
        - In range [start, start + duration):
            returns 1
        - In range [start + duration, +inf]:
            returns 0

    """
    t = time()
    return 1 if start <= t < start + duration else 0