def time2s(time):
    """ given 's.s' or 'h:m:s.s' returns s.s """
    if time:
        sec = reduce(lambda x, i: x*60 + i,
            list(map(float, time.split(':'))))
    else:
        sec = 0.0

    return sec