Captures the current wall clock time (since epoch in millisecond)
and the current time (in nanosecond) used for timing measurement.
For more info, see:
https://blogs.oracle.com/dholmes/entry/inside_the_hotspot_vm_clocks
184831
public static TimingInfo startTiming() {
        return new TimingInfo(Long.valueOf(System.currentTimeMillis()), System.nanoTime(), null);
    }
829719
def timestamp(dt):
	
	if dt.tzinfo is None:
		return time.mktime((
			dt.year, dt.month, dt.day,
			dt.hour, dt.minute, dt.second,
			-1, -1, -1)) + dt.microsecond / 1e6
	else:
		return (dt - _EPOCH).total_seconds()
293244
protected function _ago($timestamp, $current_time=null)
	{
		// Store the current time
		if (is_null($current_time))
		{
			// Get now
			$current_time = new self('now');
			$current_time = strtotime($current_time);
		}

		// Determine the difference, between the time now and the timestamp
		$difference = $current_time - $timestamp;

		// Set the periods of time
		$periods = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade');

		// Set the number of seconds per period
		$lengths = array(1, 60, 3600, 86400, 604800, 2630880, 31570560, 315705600);

		// Determine which period we should use, based on the number of seconds lapsed.
		// If the difference divided by the seconds is more than 1, we use that. Eg 1 year / 1 decade = 0.1, so we move on
		// Go from decades backwards to seconds
		for ($val = count($lengths) - 1; ($val >= 0) && (($number = $difference / $lengths[$val]) <= 1); $val--)
		{
			// Do nothing...
		}

		// Ensure the script has found a match
		if ($val < 0)
		{
			$val = 0;
		}

		// Determine the minor value, to recurse through
		$new_time = $current_time - ($difference % $lengths[$val]);

		// Set the current value to be floored
		$number = floor($number);

		// If required create a plural
		if ($number != 1)
		{
			$periods[$val] .= 's';
		}

		// Return text
		$text = sprintf("%d %s ", $number, $periods[$val]);

		// Ensure there is still something to recurse through, and we have not found 1 minute and 0 seconds.
		if (($val >= 1) && (($current_time - $new_time) > 0))
		{
			$text .= $this->_ago($new_time, $current_time);
		}

		return $text;
	}
1117510
def _get_cached_time(self):
        
        if not self._cached_time:
            self._cached_time = self._meta.datetime.utcnow()

        return self._cached_time
1007213
@SuppressWarnings({"unused", "WeakerAccess"})
    public int getTimeElapsed() {
        int currentSession = getCurrentSession();
        if (currentSession == 0) return -1;

        int now = (int) (System.currentTimeMillis() / 1000);
        return now - currentSession;
    }
950736
def timesince(self, now=None):
        
        from django.utils.timesince import timesince as timesince_
        return timesince_(self.timestamp, now)
820097
function milliseconds( $dp = null ){
	 	if( $this->is_running() ){
		 	$now = microtime( false );
		}
		else {
			$now = $this->stopped;
		}
		$started = self::parse_microtime( $this->started );
		$stopped = self::parse_microtime( $now );
		$ms = $stopped - $started;
		if( ! is_null($dp) ){
			$mult = pow( 10, $dp );
			$ms = round( $mult * $ms ) / $mult;
		}
		return $ms;
	 }
870330
function getTimestamp(rawTx) {
  const timestamp = get(
    rawTx,
    ['meta', 'metronome', 'export', 'blockTimestamp'],
    null
  )
  return timestamp ? Number(timestamp) : null
}
622731
function(time) {
			var t        = this;
			
			time = time ? time : (this.factory.time.time ? this.factory.time.time : this.factory.time.getTime());
			
			this.base(time);			
			this.meridiumText = this._isPM() ? 'PM' : 'AM';			
			this.meridium = $([
				'<ul class="flip-clock-meridium">',
					'<li>',
						'<a href="#">'+this.meridiumText+'</a>',
					'</li>',
				'</ul>'
			].join(''));
			
			this.meridium.insertAfter(this.factory.lists[this.factory.lists.length-1].$obj);
		}
1102031
private synchronized void recordElapsedTime() {
        // do nothing if the timer is not started
        if (startTime == 0)
            return;
        long current = System.nanoTime();
        // It is reported that elapsed time can be negative on some platforms.
        // Use the absolute difference to avoid infinite waits.
        timeWaited += Math.abs(current - startTime);
        // continue timing from now
        startTime = current;
    }
1103903
Instant getInstant() {
        // long tsSeconds = TimeUnit.NANOSECONDS.toSeconds(this.timestamp);
        long tsSeconds = this.timestamp / 1000000000L;
        long tsNanos = this.timestamp - (tsSeconds * 1000000000L);
        return Instant.ofEpochSecond(tsSeconds).plusNanos(tsNanos);
    }
232950
function setTimeoutWithTimestamp(callback) {
    const immediateTime = Date.now();
    let lapsedTime = Math.max(previousTime + 16, immediateTime);
    return setTimeout(function () {
        callback(previousTime = lapsedTime);
    }, lapsedTime - immediateTime);
}
236278
public long setTimestamp(long timestamp) {
    this.currentTimestamp = timestamp;
    service.tick(WallClockTimestamp.from(timestamp));
    return currentTimestamp;
  }
169140
def ToDatetime(self):
    """"""
    return datetime.utcfromtimestamp(
        self.seconds + self.nanos / float(_NANOS_PER_SECOND))
918744
protected Duration getNextTimeoutInterval() {
    Duration nextTimeoutInterval = INFINITE_FUTURE;
    if (!timers.isEmpty()) {
      // The time recorded in timer is in nano-seconds. We have to convert it to milli-seconds
      // We need to ceil the result to avoid early wake up
      nextTimeoutInterval = timers.peek().expirationTime.minusNanos(System.nanoTime());
    }
    return nextTimeoutInterval;
  }
805084
function(newTempo) {
  clock.timeStretch(context.currentTime, [freqEvent1, freqEvent2], currentTempo / newTempo)
  currentTempo = newTempo
}
471904
public static Timestamp fromEpoch(long epochMillis) {
    return Timestamp
        .newBuilder()
        .setNanos((int) ((epochMillis % MILLIS_PER_SECOND) * NANOS_PER_MILLI))
        .setSeconds(epochMillis / MILLIS_PER_SECOND)
        .build();
  }