//延时1s执行
dispatchQueue.main.asyncAfter(deadline: dispatchTime.Now() + Double(Int64(*NSEC_PER_SEC))/Double(NSEC_PER_SEC)){
//code
}