private void timer2_Tick() { while (true) { if (!InvokeRequired) { addBikeDataToList(new BikeData(bike.GetHeartRate(), bike.GetRPM(), (int)bike.GetSpeed(), bike.GetDistance(), bike.GetPower(), bike.GetEnergy(), bike.GetCurrentPower(), bike.GetTime())); } else { addBikeDataToListD delegatedata = addBikeDataToList; BikeData data = new BikeData(bike.GetHeartRate(), bike.GetRPM(), (int)bike.GetSpeed(), bike.GetDistance(), bike.GetPower(), bike.GetEnergy(), bike.GetCurrentPower(), bike.GetTime()); delegatedata(data); } Thread.Sleep(60); } }