Return time waited from wait() (#1018)