Created
February 23, 2026 20:14
-
-
Save hovsep/1cdcecf18ae10851ac019533407e2cc9 to your computer and use it in GitHub Desktop.
testing_helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // WithRunningSimulation is a helper function that runs the simulation and executes a callback after a given duration | |
| func WithRunningSimulation(sim *step_sim.Simulation, duration time.Duration, f func()) { | |
| go sim.Run() | |
| defer func() { | |
| sim.SendCommand(step_sim.Exit) | |
| }() | |
| // Let the simulation run for a while | |
| time.Sleep(duration) | |
| f() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment