import time


def time_since(ts):
    """Human-readable time since timestamp ``ts``."""
    if not ts:
        return 'never'

    units = ('secs', 'mins', 'hours')
    i = 0
    n = time.time() - ts

    while i < len(units) - 1:

        if n > 60:
            n /= 60
            i += 1

        else:
            break

    return '{:0.1f} {} ago'.format(n, units[i])