This would be even better if it supported gate delays. If it did, then we could make a ring oscillator by chaining an odd number of NOT gates in a circle, and that would just be so much fun. That sort of simulation is actually easier than it sounds; you just maintain an event queue and add a new event to the queue whenever an input to a gate changes.