<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def time_wait( predicate, timeout_seconds=120, sleep_seconds=1, ignore_exceptions=True, inverse_predicate=False, noisy=True, required_consecutive_success_count=1):
 """ waits or spins for a predicate and returns the time of the wait. An exception in the function will be returned. A timeout will throw a TimeoutExpired Exception. """

    start = time_module.time()
    wait_for(predicate, timeout_seconds, sleep_seconds, ignore_exceptions, inverse_predicate, noisy, required_consecutive_success_count)
    return elapse_time(start)