Use setImmediate if present.