for (int m = 0; m < CANMsgIdList.Count; m++) { if (CANMsgIdList[m].Bus == ConsoleApplication13.Buses.CANBusRed) { reds.Add(index); } index++; } List<double> times = new List<double>(); foreach (var i in reds) { for (int j = 1; j<index; j++) // for (int j = 1; (!(CANMsgIdList[i].MsgId == CANMsgIdList[j].MsgId)) && (j < i); j++) { if ((CANMsgIdList[j].Bus).Equals(ConsoleApplication13.Buses.CANBusYellow) &&(CANMsgIdList[j].TimeStamp > CANMsgIdList[i].TimeStamp) ) { times.Add(CANMsgIdList[j].TimeStamp- CANMsgIdList[i].TimeStamp); } } } double av = times.Sum() / times.Count; //double av = times.Count; Console.WriteLine(av);
times.Add(CANMsgIdList[j].TimeStamp- CANMsgIdList[i].TimeStamp);
An unhandled exception of type 'System.OutOfMemoryException' occurred in mscorlib.dll
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)