Sleeps until the interval has passed since the last time this function was
    called. This is a synonym for #__call__(). The first time the function is
    called will return immediately and not block. Therefore, it is important to
    put the call at the beginning of the timed block, like this:

    # Example
    ```python
    clock = Clock(fps=50)
    while True:
      clock.sleep()
      # Processing ...
    ```

def sleep(self):
    """
    Sleeps until the interval has passed since the last time this function was
    called. This is a synonym for #__call__(). The first time the function is
    called will return immediately and not block. Therefore, it is important to
    put the call at the beginning of the timed block, like this:

    # Example
    ```python
    clock = Clock(fps=50)
    while True:
      clock.sleep()
      # Processing ...
    ```
    """

    current = time.time()
    if self.last < 0:
      self.last = current
      return

    delta = current - self.last
    if delta < self.seconds:
      time.sleep(self.seconds - delta)
      self.last = time.time()