                             minimumDisplayTime: minimumDisplayTime,
                             textColor: nil)
     }
-    
+
     func checkActivityViewAppeared() -> Bool {
         for item in UIApplication.shared.keyWindow!.subviews
             where item.restorationIdentifier == "NVActivityIndicatorViewContainer" {
                 return true
         }
-        
+
         return false
     }
-    
-    func doAfter(_ after: Int64, thing: @escaping () -> Void) {
+
+    func doAfter(_ after: Int, thing: @escaping () -> Void) {
         let expectation = self.expectation(description: "")
-        
-        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(NSEC_PER_MSEC * UInt64(after)) / Double(NSEC_PER_SEC)) {
+
+        DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(after)) {
             thing()
             expectation.fulfill()
         }

            XCTAssertFalse(self.checkActivityViewAppeared())
        }
    }
    
    func testZeroMinimumDisplayTime() {
        let activityData = createActivityData(displayTimeThreshold: 0,
                                                   minimumDisplayTime: 0)
        
        XCTAssertFalse(checkActivityViewAppeared())
        NVActivityIndicatorPresenter.sharedInstance.startAnimating(activityData)
        doAfter(approximateZero) {

            XCTAssertFalse(self.checkActivityViewAppeared())
        }
    }

    // MARK: Helpers

    func createActivityData(displayTimeThreshold: Int,
                            minimumDisplayTime: Int) -> ActivityData {
        return ActivityData(size: CGSize.zero,
                            message: "",
                            type: nil,
