Utils+Foundation.swift 451 B

1234567891011121314151617181920
  1. //
  2. // Utils+Foundation.swift
  3. // CryptoSwift
  4. //
  5. // Created by Marcin Krzyzanowski on 27/09/15.
  6. // Copyright © 2015 Marcin Krzyzanowski. All rights reserved.
  7. //
  8. import Foundation
  9. func perf(text: String, closure: () -> ()) {
  10. let measurementStart = NSDate();
  11. closure()
  12. let measurementStop = NSDate();
  13. let executionTime = measurementStop.timeIntervalSinceDate(measurementStart)
  14. print("\(text) \(executionTime)");
  15. }