use settimeout when setimmediate is undef