3 ms·
What edejong said basically, Rx library uses this concept really well - you can see for example in .NET implementation [1] how the scheduler interface looks lik
by rubber_duck 10y ago
What edejong said basically, Rx library uses this concept really well - you can see for example in .NET implementation [1] how the scheduler interface looks like. They basically abstract system timer and scheduling tasks, then you can implement you own virtual time implementation where current time is just a property that you can manually set, and when you change it you go trough the list of scheduled tasks and see if you need to execute any before the new current time.
[1] https://msdn.microsoft.com/en-us/library/system.concurrency.ischeduler_members(v=vs.92).aspx https://msdn.microsoft.com/en-us/library/system.concurrency....