// Now returns the current wall time on the mock clock.
330164
func (m *Mock) Now() time.Time {
	m.mu.Lock()
	defer m.mu.Unlock()
	return m.now
}
616408
func NewClock() *Clock {
	currStamp := theTimer.Now()

	clock := new(Clock)
	clock.frameStamp = currStamp
	clock.startStamp = currStamp
	return clock
}
1046113
func Now(id ID) error {
	if !activated {
		return nil
	}
	if v, ok := chaos[id]; ok && v.Enabled {
		v.Count++
		if v.When == Once ||
			(v.Count%(r.Int()%10)) == 0 {
			if v.What == Error {
				return ErrChaos
			}
		} else {
			panic(fmt.Sprintf("Chaos triggered panic"))
		}
	}
	return nil
}
535631
func now() time.Duration {
	var now int64
	syscall.Syscall(queryPerformanceCounterProc.Addr(), 1, uintptr(unsafe.Pointer(&now)), 0, 0)
	return time.Duration(now) * time.Second / (time.Duration(qpcFrequency) * time.Nanosecond)
}
1066748
func (t *Timings) Time() int64 {
	t.mu.Lock()
	defer t.mu.Unlock()
	return t.totalTime
}
788153
func (engine *Engine) nowTime(col *core.Column) (interface{}, time.Time) {
	t := time.Now()
	var tz = engine.DatabaseTZ
	if !col.DisableTimeZone && col.TimeZone != nil {
		tz = col.TimeZone
	}
	return engine.formatTime(col.SQLType.Name, t.In(tz)), t.In(engine.TZLocation)
}
1169587
func (s *schedule) realtime(timestamp uint32) (t time.Time) {
	offset := atomic.LoadInt64(&s.offset)
	t = time.Unix(0, 0)
	t = t.Add(time.Duration(int64(timestamp)*1000 + offset))
	if t.Before(time.Now()) {
		t = t.Add(time.Duration(int64(1<<32) * 1000))
	}
	return
}
301588
func (e *eventTimestamper) Reset() {
	e.lock.Lock()
	e.timestamp = time.Now()
	e.lock.Unlock()
}
1066122
func (engine *Engine) NowTime(sqlTypeName string) interface{} {
	t := time.Now()
	return engine.FormatTime(sqlTypeName, t)
}
1305929
func (mr *MockClockMockRecorder) Now() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Now", reflect.TypeOf((*MockClock)(nil).Now))
}
946087
func SleepUntil(t time.Time) {
	now := time.Now()
	if !t.After(now) {
		// t <= now, the time has passed
		return
	}
	time.Sleep(t.Sub(now))
}
1286098
func Today(location string) (*Carbon, error) {
	l, err := time.LoadLocation(location)
	if err != nil {
		return nil, err
	}

	return NewCarbon(Now().In(l)), err
}
1097241
func (fc *fakeClock) Since(t time.Time) time.Duration {
	return fc.Now().Sub(t)
}
1336240
func (c *MockClock) Now() time.Time {
	c.mutex.Lock()
	defer c.mutex.Unlock()

	return c.now
}
281706
func (p *Player) Current() time.Duration {
	sample := int64(0)
	p.sync(func() {
		sample = p.pos / bytesPerSample / channelNum
	})
	return time.Duration(sample) * time.Second / time.Duration(p.sampleRate)
}
934359
func (timeCache *timeFormatCacheType) fresh() {
	timeCache.lock.Lock()
	defer timeCache.lock.Unlock()

	// get current time and update timeCache
	now := time.Now()
	timeCache.now = now
	timeCache.format = []byte(now.Format(PrefixTimeFormat))
	date := now.Format(DateFormat)
	if date != timeCache.date {
		timeCache.dateYesterday = timeCache.date
		timeCache.date = now.Format(DateFormat)
	}
}
644120
func addTimestamp(buffer *bytes.Buffer) {
	now := now()
	year, month, day := now.Date()
	hour, minute, second := now.Clock()

	var tmp = new([23]byte)
	writeInt(tmp, 4, 0, year)
	tmp[4] = '-'
	writeInt(tmp, 2, 5, int(month))
	tmp[7] = '-'
	writeInt(tmp, 2, 8, day)
	tmp[10] = ' '
	writeInt(tmp, 2, 11, hour)
	tmp[13] = ':'
	writeInt(tmp, 2, 14, minute)
	tmp[16] = ':'
	writeInt(tmp, 2, 17, second)
	tmp[19] = '.'
	writeInt(tmp, 3, 20, now.Nanosecond()/1000000)
	buffer.Write(tmp[:])
}