public static void randomSimulation(StoreParams sp) { Store store = new Store(sp); DateTime lastTick = DateTime.Now; while (true) { store.Simulate((DateTime.Now - lastTick).TotalMilliseconds); lastTick = DateTime.Now; //sleep it a bit to get a better sample from rand System.Threading.Thread.Sleep(10); } }