flushMicrotasks and flushTimers

I think there should be some kind of timeout here.