public void GetCookiesFrom(Bakery bakery) { var stopwatch = new Stopwatch(); stopwatch.Start(); while (bakery.InStock) { if (stopwatch.ElapsedMilliseconds < Root.BuyingTime) continue; bakery.SellCookieTo(this); stopwatch.Restart(); } }