code: func (s *Simulator) AdvanceTime(d time.Duration) {
  	switch {
  	case d == 0:
  		return
  	case d < 0:
  		panic("time must move forward only")
  	}
  
  	// First tick ever? Reset Now to Epoch, since Epoch is our beginning of times.
  	if s.Now.IsZero() {
  		s.Now = s.Epoch
  	}
  
  	deadline := s.Now.Add(d)
  	for {
  		// Nothing is happening at all or events happen later than we wish to go?
  		if ev := s.peekEvent(); ev == nil || ev.eta.After(deadline) {
  			s.Now = deadline
  			return
  		}
  
  		// Advance the time to the point when the event is happening and execute the
  		// event's callback. It may result in most stuff added to the timeline which
  		// we will discover on the next iteration of the loop.
  		ev := s.popEvent()
  		s.Now = ev.eta
  		ev.cb()
  	}
  }
docs: // AdvanceTime moves the simulated time, executing all events that happen.