Called internally or externally in write delay intervals.
18416
public void sync() {

        if (isClosed) {
            return;
        }

        synchronized (fileStreamOut) {
            if (needsSync) {
                if (busyWriting) {
                    forceSync = true;

                    return;
                }

                try {
                    fileStreamOut.flush();
                    outDescriptor.sync();

                    syncCount++;
                } catch (IOException e) {
                    Error.printSystemOut("flush() or sync() error: "
                                         + e.toString());
                }

                needsSync = false;
                forceSync = false;
            }
        }
    }
1332526
@Override
  public void write(JsonWriter out, MarkTiming markTiming) throws IOException {
    out.beginArray();

    out.value(markTiming.getMark());
    out.value(markTiming.getTime());

    out.endArray();
    out.flush();
  }
1145089
def _trigger_batch_write():
    """"""
    global _batch_future

    LOGGER.debug('Batch write triggered (%r/%r)',
                 _buffer_size, _trigger_size)
    _maybe_stop_timeout()
    _maybe_warn_about_buffer_size()
    _batch_future = _write_measurements()
    return _batch_future
511525
def delay(self, dl=0):
        
        if dl is None:
            time.sleep(self.dl)
        elif dl < 0:
            sys.stderr.write(
                "delay cannot less than zero, this takes no effects.\n")
        else:
            time.sleep(dl)
746273
private int externalAwaitDone() {
    int s = ((this instanceof CountedCompleter) ? // try helping
        ForkJoinPool.common.externalHelpComplete((CountedCompleter<?>) this, 0)
        : ForkJoinPool.common.tryExternalUnpush(this) ? doExec() : 0);
    if (s >= 0 && (s = status) >= 0) {
      boolean interrupted = false;
      do {
        if (U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
          synchronized (this) {
            if (status >= 0) {
              try {
                wait(0L);
              } catch (InterruptedException ie) {
                interrupted = true;
              }
            } else
              notifyAll();
          }
        }
      } while ((s = status) >= 0);
      if (interrupted)
        Thread.currentThread().interrupt();
    }
    return s;
  }
758796
public static void scheduleAtFixedRate(
      final ScheduledExecutorService exec,
      final Duration initialDelay,
      final Duration period,
      final Runnable runnable
  )
  {
    scheduleAtFixedRate(exec, initialDelay, period, new Callable<Signal>()
    {
      @Override
      public Signal call()
      {
        runnable.run();
        return Signal.REPEAT;
      }
    });
  }
368346
void writeExternal(DataOutput out) throws IOException {
        Ser.writeEpochSec(toEpochSecond(), out);
        Ser.writeOffset(offsetBefore, out);
        Ser.writeOffset(offsetAfter, out);
    }
12793
protected void writeTemporalProposition(ObjectOutputStream s)
            throws IOException {
        if (this.interval instanceof SimpleInterval) {
            long start = this.interval.getMinStart();
            long finish = this.interval.getMinFinish();
            Granularity startGran = this.interval.getStartGranularity();
            Granularity finishGran = this.interval.getFinishGranularity();
            if (start == finish && startGran == finishGran) {
                s.writeChar(0);
                s.writeLong(start);
                s.writeObject(startGran);
            } else {
                s.writeChar(1);
                s.writeLong(start);
                s.writeObject(startGran);
                s.writeLong(finish);
                s.writeObject(finishGran);
            }
        } else {
            s.writeChar(2);
            s.writeObject(this.interval.getMinStart());
            s.writeObject(this.interval.getMaxStart());
            s.writeObject(this.interval.getStartGranularity());
            s.writeObject(this.interval.getMinFinish());
            s.writeObject(this.interval.getMaxFinish());
            s.writeObject(this.interval.getFinishGranularity());
        }

    }
1129927
function internalStart(test) {

  	// If semaphore is non-numeric, throw error
  	if (isNaN(test.semaphore)) {
  		test.semaphore = 0;

  		pushFailure("Invalid value on test.semaphore", sourceFromStacktrace(2));
  		return;
  	}

  	// Don't start until equal number of stop-calls
  	if (test.semaphore > 0) {
  		return;
  	}

  	// Throw an Error if start is called more often than stop
  	if (test.semaphore < 0) {
  		test.semaphore = 0;

  		pushFailure("Tried to restart test while already started (test's semaphore was 0 already)", sourceFromStacktrace(2));
  		return;
  	}

  	// Add a slight delay to allow more assertions etc.
  	if (defined.setTimeout) {
  		if (config.timeout) {
  			clearTimeout(config.timeout);
  		}
  		config.timeout = setTimeout(function () {
  			if (test.semaphore > 0) {
  				return;
  			}

  			if (config.timeout) {
  				clearTimeout(config.timeout);
  			}

  			begin();
  		}, 13);
  	} else {
  		begin();
  	}
  }
729128
private static void waiting(int milliseconds) {
        long t0, t1;
        t0 = System.currentTimeMillis();
        do {
            t1 = System.currentTimeMillis();
        } while ((t1 - t0) < milliseconds);
    }
1236974
public void setInterval(ReadableInstant start, ReadableInstant end) {
        if (start == null && end == null) {
            long now = DateTimeUtils.currentTimeMillis();
            setInterval(now, now);
        } else {
            long startMillis = DateTimeUtils.getInstantMillis(start);
            long endMillis = DateTimeUtils.getInstantMillis(end);
            Chronology chrono = DateTimeUtils.getInstantChronology(start);
            super.setInterval(startMillis, endMillis, chrono);
        }
    }
1178519
private int externalInterruptibleAwaitDone() throws InterruptedException {
        int s;
        if (Thread.interrupted())
            throw new InterruptedException();
        while ((s = status) >= 0) {
            if (U.compareAndSwapInt(this, STATUS, s, s | SIGNAL)) {
                synchronized (this) {
                    if (status >= 0)
                        wait();
                    else
                        notifyAll();
                }
            }
        }
        return s;
    }
627855
def timing(self, stat, delta, rate=1):
        """"""
        return self.send(stat, "%d|ms" % delta, rate)
1250527
private void startIdleTimer(final DownstreamChannel downstreamChannel, int delayInMilliseconds) {
        LOG.fine("Starting idle timer");
        if (downstreamChannel.idleTimer != null) {
            downstreamChannel.idleTimer.cancel();
            downstreamChannel.idleTimer = null;
        }
        
        downstreamChannel.idleTimer = new Timer();
        downstreamChannel.idleTimer.schedule(new TimerTask() {
            
            @Override
            public void run() {
                idleTimerHandler(downstreamChannel);
            }
            
        }, delayInMilliseconds);
    }
275393
function onWrite (c) {
  if (c[c.length - 1] === '\n') {
    console.log(c.substr(0, c.length - 1))
  } else {
    console.log(c)
  }
}
540855
void delay(long alreadyElapsed) {
    recorder.recordValue(alreadyElapsed);
    if (distribution != null) {
      long nextPermitted = Math.round(distribution.sample() * 1000000000.0);
      if (nextPermitted > alreadyElapsed) {
        LockSupport.parkNanos(nextPermitted - alreadyElapsed);
      }
    }
  }
1183365
function setTimeouts($read = 0, $write = 0)
    {
        if ($read) {
            $this->readTimeout['sec'] = (int)($read / 1000);
            $this->readTimeout['usec'] = ($read % 1000) * 1000;
        }
        if ($write) {
            $this->writeTimeout['sec'] = (int)($write / 1000);
            $this->writeTimeout['usec'] = ($write % 1000) * 1000;
        }
    }