title: What is the purpose of Semaphore.wait(timeout: .now())?
body: <p>Looking at some Apple code sample, I found this:</p>
  
  <pre><code>func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {
      // wait() is used to drop new notifications if old ones are still processing, to avoid queueing up a bunch of stale data.
      if metadataObjectsOverlayLayersDrawingSemaphore.wait(timeout: .now()) == .success {
          DispatchQueue.main.async {
              // Some processing...
  
              self.metadataObjectsOverlayLayersDrawingSemaphore.signal()
          }
      }
  }
  </code></pre>
  
  <p><strong><em>Context of the code</em></strong>: This is the delegate method when using video capture to detect a QR code (or any other code).
  Because it is triggered many times per second (if the camera stays on the same QR code), some kind of timeout is needed.</p>
  
  <p>But how does <code>DispatchSemaphore.wait(timeout: .now())</code> work? And why check if it is <code>.success</code>?</p>