I don’t know. I dropped Rules DSL years ago and have not kept all these old Rules DSL examples up to date. I probably should work the same but
.
I know there have been changes in how Rules DSL rules are executed since OH 3 which could be a problem. Each rule gets it’s own thread but all the timers created in that rule also share a thread. So it might be possible that there might be a collision between the timer and the rule. I don’t know what would happen in that case.
You have to import Queue too.
For the latest maintained implementation of this see openHAB Rules Tools Announcements which provides a library implementation of most of the design patterns.