or how about sleep(@iam_credentials_expire_at - Time.now.to_i) ?