swift timeinterval to seconds code example
Example 1: swift get current time
let date = Date()
let calendar = Calendar.current
let hour = calendar.component(.hour, from: date)
let minutes = calendar.component(.minute, from: date)
Example 2: swift wait 5 seconds
sleep(5). // Argument is number of seconds