def format_time(time, unit, delimiter=False):
    """
    A function to format a unit of time, so it is readable when it is
    output to Discord.
    """

    if time > 0:
        if time > 1:
            unit += 's'

        elapsed = f"{time} {unit}"

        if delimiter:
            elapsed += ','

        return elapsed

    return ''