code: public void awaitCount(long totalCount, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException
    {
      checkTotalCount(totalCount);
      long nanos = unit.toNanos(timeout);
      long currentCount = sync.getCount();
      while (compareCounts(totalCount, currentCount) > 0) {
        if (!sync.tryAcquireSharedNanos(currentCount, nanos)) {
          throw new TimeoutException();
        }
        currentCount = sync.getCount();
      }
    }
docs: Await until the {@link #increment} is called on this counter object the specified number of times from the creation
  of this counter object, for not longer than the specified period of time. If by this time the target increment
  count is not reached, {@link TimeoutException} is thrown.