Class Clock

java.lang.Object
io.zucchini.circuitsimtester.api.MockPulser
io.zucchini.circuitsimtester.api.Clock

public class Clock extends MockPulser
Allows pretending to tick a Clock component placed in a subcircuit.

(In reality, this manipulates an InputPin wired to where the clock component was; see MockPulser)

  • Constructor Details

  • Method Details

    • tick

      public void tick()
      Tick the clock once.
    • tickUntil

      public long tickUntil(long maxCycleCount, BooleanSupplier stopWhen)
      Tick the clock until stopWhen returns true.
      Parameters:
      maxCycleCount - the number of cycles before timeout (to avoid infinitely spinning)
      stopWhen - returns true when we can stop ticking the clock (e.g., the student's processor has finished running and is sending the "done" signal)
      Returns:
      the number of ticks performed until stopWhen returned true. May be zero if the condition was initially met