I can not get the value of the time interval between two points in time, between endDate [i] and startDate [i + 1] (that is, between the stop and the next start) and that everything is output to the String array.
var startDate = [String]() endDate = [String]() interval = [String]() let date = NSDate() var i = 0 let dateFormatter = DateFormatter() dateFormatter.dateFormat = "HH:mm:ss" // 袧袗袞袠袦袗袝袦 袧袗 小孝袗袪孝 i += 1 let stringDate = dateFormatter.string(from: date as Date) startDate.append(stringDate) // 袙蝎效袠小袥携袝袦 袟袧袗效袝袧袠袝 袠袧孝袝袪袙袗袥袗 KAK ??????????????????????????????????????? let intervalDate = startDate[i + 1] - endDate[i] // ?????????????????? interval.append(intervalDate) print(interval) //袧袗袞袠袦袗袝袦 小孝袨袩 let stringDate = dateFormatter.string(from: date as Date) endDate.append(stringDate)