We who are more used to writing realtime code dont't use delays in our code.
We want all the CPU cycles we can get.
You do it like this:
You have 2 kind of events, either a key played or time lapsed.
Increment a counter, if time reached or event happened, do your stuff.
By nonblocking you just increment the counter and do any if count or event.
It's easy.