SHARE
TWEET

Untitled

a guest Jun 15th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func testTimerIsStarted() {
  2.     let expectation = self.expectation(description: #function)
  3.  
  4.     let timer = DispatchSource.createRepeating(interval: 0, deadline: DispatchTime.now()) {
  5.         expectation.fulfill()
  6.     }
  7.     waitForExpectations(timeout: 0.02)
  8. }
  9.      
  10. func testTimerIsStarted() {
  11.     let expectation = self.expectation(description: #function)
  12.  
  13.     let timer = DispatchSource.createRepeating(interval: 0, deadline: DispatchTime.now()) {
  14.         expectation.fulfill()
  15.     }
  16.  
  17.     withExtendedLifetime(timer) { timer in
  18.         waitForExpectations(timeout: 0.02)
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top