Override setTimeout and provide timeout flushing