// During returns true if a time is between two other times
// (by default, inclusive for the start, exclusive for the end).
515804
func (t Term) During(startTime, endTime interface{}, optArgs ...DuringOpts) Term {
	opts := map[string]interface{}{}
	if len(optArgs) >= 1 {
		opts = optArgs[0].toMap()
	}
	return constructMethodTerm(t, "During", p.Term_DURING, []interface{}{startTime, endTime}, opts)
}
15465
func IsWeekend(date time.Time) bool {
	day := date.Weekday()
	return day == time.Saturday || day == time.Sunday
}
494525
func MaxTime(a, b time.Time) time.Time {
	if a.After(b) {
		return a
	}
	return b
}
1013515
func (t *Timer) Since(start time.Time) {
	t.Update(time.Since(start))
}
462655
func (t *Timer) Stop() bool {
	if t.timer != nil {
		return t.timer.Stop()
	}

	registered := !t.stopped
	t.mock.removeClockTimer((*internalTimer)(t))
	t.stopped = true
	return registered
}
498085
func (f *FakeClock) Since(ts time.Time) time.Duration {
	f.lock.RLock()
	defer f.lock.RUnlock()
	return f.time.Sub(ts)
}
27740
func (s *StdoutClient) Timing(stat string, delta int64) error {
	return s.send(stat, "%d|ms", delta)
}
224096
func (s *sender) Timing(stat string, duration time.Duration, tags ...string) {
	s.c <- fmt.Sprintf("%s:%f|ms%s\n", stat, duration.Seconds()*1000, t(tags))
}
540594
func (c *expvarStatsClient) Timing(name string, value time.Duration, rate float64) {
	c.mu.Lock()
	d, _ := c.m.Get(name).(time.Duration)
	c.m.Set(name, d+value)
	c.mu.Unlock()
}
246812
func (i *IntervalClock) Since(ts time.Time) time.Duration {
	return i.Time.Sub(ts)
}
469223
func before(now, notBefore time.Time) bool {
	return now.Add(allowedClockDrift).Before(notBefore)
}
834827
func (f *FakeClock) Since(ts time.Time) time.Duration {
	return f.Time.Sub(ts)
}
647616
func (tu timeUtil) Start(times ...time.Time) time.Time {
	if len(times) == 0 {
		return time.Time{}
	}

	start := times[0]
	for _, t := range times[1:] {
		if t.Before(start) {
			start = t
		}
	}
	return start
}
122006
func (c *Call) After(d time.Duration) *Call {
	c.lock()
	defer c.unlock()
	c.waitTime = d
	return c
}
1151861
func (s *DescribeCasesInput) SetAfterTime(v string) *DescribeCasesInput {
	s.AfterTime = &v
	return s
}
388443
func Interval(duration time.Duration) Expression {
	negative := false
	if duration < 0 {
		negative = true
		duration = -duration
	}
	return &intervalExpression{
		duration: duration,
		negative: negative,
	}
}
1321486
func (r Range) Since(t time.Time) Range {
	if t.Before(r.Start) {
		return r
	}
	if t.After(r.End) {
		return Range{}
	}
	return Range{Start: t, End: r.End}
}