Delays an action by a certain amount of time to decide whether the action is really necessary. The delayed action is encoded by an open thunk; the close thunk cleans up after this action if it occurs.
The open thunk will be scheduled for invocation time seconds after the call to mred:delay-action. (The time value can be a fraction of a second.) The return value of mred:delay-action is a thunk that invokes the close thunk only if the open thunk has been invoked, or cancels the scheduled invocation of open otherwise.
For example, this code shows the busy waiting cursor only if do-the-thing takes longer than 2 seconds to execute:
(let ([cursor-off (mred:delay-action 2 wx:begin-busy-cursor wx:end-busy-cursor)]) (do-the-thing) (cursor-off))