private void Sender() { var sw = new Stopwatch(); while (IsRunningThread) { if (gps != null) { var datastreamToSend = gps.PopData(); sw.Restart(); Publish(datastreamToSend); sw.Stop(); gps.SetTransportedTime((float)sw.Elapsed.TotalSeconds); } } }
private void Sender() { Stopwatch sw = new Stopwatch(); while (true) { if (gps == null) { continue; } var datastreamToSend = gps.PopData(); sw.Restart(); Publish(datastreamToSend); sw.Stop(); gps.SetTransportTime((float)sw.Elapsed.TotalSeconds); } }