How to asynchronously (non-blocking) schedule a function to execute after a specific delay?

How to asynchronously (non-blocking) schedule a function to execute after a specific delay? Foe example, how to realize the functionality described in the following pseudo-code?

input.onButtonPressed(Button.A, function () {

do_this_async(function(){
    basic.pause(3000)
    basic.showIcon(IconNames.Happy)
})

basic.showIcon(IconNames.Triangle)

})

I made a port of the arcade-timers extension for micro:bit.

You can learn about the extension here: