// Advance the current time according to the clock by the supplied duration.
338947
func (sc *SimulatedClock) AdvanceTime(d time.Duration) {
	sc.mu.Lock()
	defer sc.mu.Unlock()

	sc.t = sc.t.Add(d)
}
1325624
func (l *Scanner) Advance(n int) bool {
	l.pos += n
	if l.pos > len(l.data) {
		l.pos = len(l.data)
		return false
	}
	return true
}
381610
func Incremental(initial, increment time.Duration) Algorithm {
	return func(attempt uint) time.Duration {
		return initial + (increment * time.Duration(attempt))
	}
}
972649
func (t *StandardResettingTimer) Time(f func()) {
	ts := time.Now()
	f()
	t.Update(time.Since(ts))
}
738131
func Delay(duration int) {
	time.Sleep(time.Duration(duration) * time.Millisecond)
}
131922
func (l *TimeLimiter) Add(d time.Duration) {
	l.add(time.Now(), d)
}
608169
func (a MultiStatsClient) Timing(name string, value time.Duration, rate float64) {
	for _, c := range a {
		c.Timing(name, value, rate)
	}
}
475354
func (t Time) Clock() (hour int, minute int, second int) {
	return t.Time.Hour(), t.Time.Minute(), t.Time.Second()
}
882487
func (t *Timer) Update(d time.Duration) {
	v := Floor(d.Seconds() * 1000)
	t.r.Update(v)
}
767518
func (r *progressReporter) advance(f fs.File) {
	if r.totalCount == 0 {
		return
	}

	now := clock.Now(r.ctx)
	reportNow := false
	progress := 0

	// We don't count size of the symlinks toward total.
	var size uint64
	if !f.Symlink() {
		size = f.Size()
	}

	// Report progress on first and last 'advance' calls and each 2 sec.
	r.Lock()
	r.extractedSize += size
	r.extractedCount++
	if r.extractedCount == 1 || r.extractedCount == r.totalCount || now.Sub(r.prevReport) > 2*time.Second {
		reportNow = true
		if r.totalSize != 0 {
			progress = int(float64(r.extractedSize) * 100 / float64(r.totalSize))
		} else {
			progress = int(float64(r.extractedCount) * 100 / float64(r.totalCount))
		}
		r.prevReport = now
	}
	r.Unlock()

	if reportNow {
		logging.Infof(r.ctx, "cipd: extracting - %d%%", progress)
	}
}
656797
func Clock(clock timetools.TimeProvider) TokenLimiterOption {
	return func(cl *TokenLimiter) error {
		cl.clock = clock
		return nil
	}
}
1340563
func (scanner *Scanner) Advance() {
	if scanner.CanRead() {
		scanner.index++
		if scanner.CanRead() && scanner.Char() == '\n' {
			scanner.row++
			scanner.col = 1
		} else {
			scanner.col++
		}
	}
}
875342
func Time(from time.Time, maxDelta time.Duration) time.Time {
	globalLk.Lock()
	defer globalLk.Unlock()
	return globalGen.Time(from, maxDelta)
}
362031
func (s *Snapshotter) updateClock() {
	lastSeen := s.clock.Time() - 1
	if lastSeen > s.lastClock {
		s.lastClock = lastSeen
		s.tryAppend(fmt.Sprintf("clock: %d\n", s.lastClock))
	}
}
1067022
func (fc *fakeClock) Now() time.Time {
	fc.l.RLock()
	t := fc.time
	fc.l.RUnlock()
	return t
}
7406
func (dt DateTime) Add(duration time.Duration) DateTime {
	t := dt.t.Add(toSeconds(duration))
	return DateTime{t: t}
}
1208064
func GreaterTime(t1, t2 time.Time) time.Time {
	if IsGreaterThan(t1, t2, false) {
		return t1
	}
	return t2
}