<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format_sec(s):
 """ Format seconds in a more human readable way. It supports units down to nanoseconds. :param s: Float of seconds to format :return: String second representation, like 12.4 us """


    prefixes = ["", "m", "u", "n"]
    unit = 0

    while s < 1 and unit + 1 < len(prefixes):
        s *= 1000
        unit += 1

    return "{:.1f} {}s".format(s, prefixes[unit])