public IEnumerable <ILogItem> Tickers() { Random random = new Random(); int Limit = 50; while (Limit > 0) { yield return(TickerFabrika.GetNewTicker()); Thread.Sleep(random.Next(20, 500)); Limit--; } }
public static IEnumerable <ILogItem> Tickers(int amount) { Random random = new Random(); int Limit = amount; while (Limit > 0) { var logItem = TickerFabrika.GetNewTicker(); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write(logItem.TypeId + " "); yield return(logItem); Thread.Sleep(random.Next(20, 50)); Limit--; } }