import time


def timer(laps):
    """ if laps is None, initialize
    otherwise return time since last lap."""
    if laps is None:
        return [time.time()]
    laps.append(time.time())
    return laps[-1] - laps[-2]