Start counting time

@param key the key for the timestamp
@return the timestamp
505436
public static long start(String key) {

        if (key.isEmpty()) {
            throw new InvalidKeyForTimeStampException();
        }

        // current timestamp
        long timestamp = QuickUtils.date.getCurrentTimeInMiliseconds();

        // save the timestamp
        QuickUtils.prefs.save(TIMER_PREFIX + key, timestamp);

        return timestamp;
    }
1226343
@Override
    public Number getNumber(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        final int index = indexForColumnName(key);
        return index >= 0 ? getNumber(index) : null;
    }
527509
public static function time($key = null) {

		if(null !== $key && false === is_string($key)) {
 			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($key)), E_USER_ERROR);
		}

		if(count(static :: $time) === 0) {
			static :: $time = [];
		}

		if(null !== $key) {
			
			static :: $time[] = ['time' => microtime(), 'key' => $key];
			return;
		}

		static :: $time[] = ['time' => microtime(), 'key' => 'end'];
		
		$laps = [];

		for($i = 1; $i < count(static :: $time); $i++) {

			$start 	= explode(' ', static :: $time[$i - 1]['time']);
			$end  	= explode(' ', static :: $time[$i]['time']);

			$laps[static :: $time[$i - 1]['key'] . ' - ' . static :: $time[$i]['key']] = number_format((($end[1] + $end[0]) - ($start[1] + $start[0])), 4, '.', '');
		}

		return $laps;
	}
27596
def track_duration(self, key):
        
        if key not in self.durations:
            self.durations[key] = []
        start_time = time.time()
        try:
            yield
        finally:
            self.durations[key].append(
                max(start_time, time.time()) - start_time)
836208
public final Optional<T> getScheduledTask(K key) {
    CancellableTask<K, T> cancellableTask = this.cancellableTaskMap.getIfPresent(key);
    if (cancellableTask != null) {
      return Optional.of(cancellableTask.getScheduledTask());
    }
    return Optional.absent();
  }
845960
@SuppressWarnings("unchecked")
  public final <T> T get(final String key)
      throws TimeoutException, InterruptedException, MemcachedException {
    return (T) this.get(key, this.opTimeout);
  }
299209
public Long expireAt(Object key, long unixTime) {
		Jedis jedis = getJedis();
		try {
			return jedis.expireAt(keyToBytes(key), unixTime);
		}
		finally {close(jedis);}
	}
1252706
public JsonReaderI<?> startObject(String key) throws ParseException, IOException {
		throw new RuntimeException(ERR_MSG + " startObject(String key) in " + this.getClass() + " key=" + key);
	}
573067
public static KeyStroke getKeyStroke(String key) throws NoSuchElementException
	{
		key = key.toUpperCase();
		int _sep = key.indexOf("/");
		String _mask = key.substring(0, _sep);
		String _keyCode = key.substring(_sep + 1);
		Integer _m = theMaskTable.get(_mask);
		Integer _t = theKeyTable.get(_keyCode);
		if (null == _m || null == _t)
		{
			throw new NoSuchElementException(key);
		}
		return (KeyStroke.getKeyStroke(_t.intValue(), _m.intValue()));
	}
96053
public final int get(String key)
  {

    for (int i = 0; i < m_firstFree; i++)
    {
      if (m_map[i].equals(key))
        return m_values[i];
    }

    return INVALID_KEY;
  }
1012640
public long nextKey() {
        // Note that per Oracle the currentTimeMillis is the current number of seconds past the epoch
        // in UTC (not in local time). Therefore, processes with exactly synchronized clocks will
        // always get the same value regardless of their timezone ...
        final long timestamp = System.currentTimeMillis();
        final int increment = counterFor(timestamp);
        if (increment <= maximumCounterValue) {
            return (timestamp << counterBits) + increment;
        }
        // The counter is surprisingly too high, so try again (repeatedly) until we get to the next millisecond ...
        return this.nextKey();
    }
107944
public static <T> com.simiacryptus.util.lang.TimedResult<T> time(@javax.annotation.Nonnull final UncheckedSupplier<T> fn) {
    long priorGcMs = ManagementFactory.getGarbageCollectorMXBeans().stream().mapToLong(x -> x.getCollectionTime()).sum();
    final long start = System.nanoTime();
    @Nullable T result = null;
    try {
      result = fn.get();
    } catch (@javax.annotation.Nonnull final RuntimeException e) {
      throw e;
    } catch (@javax.annotation.Nonnull final Exception e) {
      throw new RuntimeException(e);
    }
    long wallClockTime = System.nanoTime() - start;
    long gcTime = ManagementFactory.getGarbageCollectorMXBeans().stream().mapToLong(x -> x.getCollectionTime()).sum() - priorGcMs;
    return new com.simiacryptus.util.lang.TimedResult<T>(result, wallClockTime, gcTime);
  }
92370
@Override
    public ScheduledEntry<K, V> get(K key) {
        synchronized (mutex) {
            if (scheduleType.equals(ScheduleType.FOR_EACH)) {
                return getByCompositeKey(key);
            }
            Integer second = secondsOfKeys.get(key);
            if (second != null) {
                Map<Object, ScheduledEntry<K, V>> entries = scheduledEntries.get(second);
                if (entries != null) {
                    return entries.get(key);
                }
            }
            return null;
        }
    }
1303822
public boolean startsWith(final Bits key) {
    if (key.bitLength > this.bitLength) {
      return false;
    }
    final Bits prefix = key.bitLength < this.bitLength ? this.range(0,
      key.bitLength) : this;
    return prefix.compareTo(key) == 0;
  }
1306580
public synchronized Instant getStartTime(TimestampProvider times) {
        if (startTime==null) {
            startTime = times.getTime();
        }
        return startTime;
    }
1355028
public long getTimeSpentInQueue() {
        lock.readLock().lock();
        try {
            return startTime - workUnit.context.item.buildableStartMilliseconds;
        } finally {
            lock.readLock().unlock();
        }
    }
107281
public static long getMonthStartTime(final long time) {
        final Calendar start = Calendar.getInstance();
        start.setTimeInMillis(time);
        final int year = start.get(Calendar.YEAR);
        final int month = start.get(Calendar.MONTH);
        start.set(year, month, 1, 0, 0, 0);
        start.set(Calendar.MILLISECOND, 0);

        return start.getTimeInMillis();
    }