if setImmediate is supported, setImmediate, else setTimeout