     //[self performSelector:@selector(fetchHistory:) withObject:nil afterDelay:10];
     
     // This is to just test decoding history
-    //[self performSelector:@selector(testDecodeHistory) withObject:nil afterDelay:1];
+    //performSelector(Selector("testDecodeHistory"), withObject: nil, afterDelay: 1)
     
     // Test storing MySentry packet:
     //[self performSelector:@selector(testHandleMySentry) withObject:nil afterDelay:10];

  
  func flushTreatments() {
    if (self.treatmentsQueue.count == 0) {
    return;
    }
    
    let inFlightTreatments = treatmentsQueue

  
  func addTreatment(treatment:NightscoutTreatment, pumpModel:PumpModel) {
    if sendEntriesNewerThan == nil || treatment.timestamp.timeIntervalSinceDate(sendEntriesNewerThan!) > 0 {
      var rep = treatment.dictionaryRepresentation
      if rep["created_at"] == nil && rep["timestamp"] != nil {
        rep["created_at"] = rep["timestamp"]
      }
      if rep["created_at"] == nil {
        rep["created_at"] = TimeFormat.timestampStrFromDate(NSDate())
      }
      treatmentsQueue.append(rep)
    }
  }
  
