// RatioClock sets a clock
190927
func RatioClock(clock timetools.TimeProvider) ratioOptSetter {
	return func(r *RatioCounter) error {
		r.clock = clock
		return nil
	}
}
346133
func (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time {
	return k.RangeTimeFormat(time.RFC3339, defaultVal, min, max)
}
253259
func (m *MockClock) SetTime(t time.Time) {
	m.cond.L.Lock()
	defer m.cond.L.Unlock()

	assertFuture(m.now, t)
	m.now = t
	m.cond.Broadcast()
}
972649
func (t *StandardResettingTimer) Time(f func()) {
	ts := time.Now()
	f()
	t.Update(time.Since(ts))
}
55099
func (fc *FakeClock) FakeTimer(d time.Duration) *FakeTimer {
	fc.Lock()
	defer fc.Unlock()

	c := make(chan time.Time, 1)
	t := &FakeTimer{
		c:     c,
		clock: fc,
		time:  fc.now.Add(d),
	}
	fc.addTimer(t)
	return t
}
819201
func (tr Row) Localtime(nn int) (val time.Time) {
	val, err := tr.LocaltimeErr(nn)
	if err != nil {
		panic(err)
	}
	return
}
407670
func (s *Sinc) TransitionFreq() float64 {
	if s == nil {
		return 0
	}
	return s.CutOffFreq / float64(s.SamplingFreq)
}
616408
func NewClock() *Clock {
	currStamp := theTimer.Now()

	clock := new(Clock)
	clock.frameStamp = currStamp
	clock.startStamp = currStamp
	return clock
}
589964
func (f *FakeClock) Step(d time.Duration) {
	f.Time = f.Time.Add(d)
}
1066748
func (t *Timings) Time() int64 {
	t.mu.Lock()
	defer t.mu.Unlock()
	return t.totalTime
}
122495
func (d *DefaultMetricCollector) RunDuration() *rolling.Timing {
	d.mutex.RLock()
	defer d.mutex.RUnlock()
	return d.runDuration
}
1087164
func NewMockClock(ctrl *gomock.Controller) *MockClock {
	mock := &MockClock{ctrl: ctrl}
	mock.recorder = &MockClockMockRecorder{mock}
	return mock
}
197894
func (ctr *rowConstructor) Ratio(ratio ...float64) {
	layout := ctr.win.layout
	panelLayout(ctr.win.ctx, ctr.win, ctr.height, len(ratio), 0)

	/* calculate width of undefined widget ratios */
	r := 0.0
	n_undef := 0
	layout.Row.Ratio = ratio
	for i := range ratio {
		if ratio[i] < 0.0 {
			n_undef++
		} else {
			r += ratio[i]
		}
	}

	r = saturateFloat(1.0 - r)
	layout.Row.Type = layoutDynamic
	layout.Row.ItemWidth = 0
	layout.Row.ItemRatio = 0.0
	if r > 0 && n_undef > 0 {
		layout.Row.ItemRatio = (r / float64(n_undef))
	}

	layout.Row.ItemOffset = 0
	layout.Row.Filled = 0

}
1292991
func (f *FakeClock) Now() time.Time {
	f.lock.RLock()
	defer f.lock.RUnlock()
	return f.time
}
1222284
func (c *ConfigLocal) Clock() Clock {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.clock
}
1060871
func (sc *SimulatedClock) SetTime(t time.Time) {
	sc.mu.Lock()
	defer sc.mu.Unlock()

	sc.t = t
}
400916
func (dc DefaultClock) AfterFunc(d time.Duration, f func()) Timer {
	return &defaultTimer{*time.AfterFunc(d, f)}
}