Avatar
@swift-5.2.5 import Foundation func proc(count: Int, idx: Int) { var st = Set<Int>() for i in 0..<count { st.insert(i) } let mid = count >> 1 let start = Date() st.remove(mid) let elapsed = Date().timeIntervalSince(start) print(idx, elapsed) } for d in 1...7 { let c = (pow(10, d) as NSDecimalNumber).intValue proc(count: c, idx: d) }