It does not meet all your criteria, but ... I wrote a series of blog posts about the timer queue for windows, which is implemented from the point of view of an external time provider, and which is either polled or controlled by a flow, The series comes with source code and tests, and the purpose of this was to demonstrate testing fairly complex code. Anyway, you can use some of the codes or ideas if no one comes up better.
Articles start here: http://www.lenholgate.com/archives/000306.html
source
share