// GetTime returns the current time based on the clock calibration.
GetTime returns the current time based on the clock calibration.
// GetTime returns the current time based on the clock calibration .
func (c *CalibratedClock) GetTime() (int64, error) {
	c.mu.RLock()
	if !c.ready {
		now, err := c.ref.Syscall()
		c.mu.RUnlock()
		return int64(now), err
	}
	now := c.ref.Cycles()
	v, ok := c.params.ComputeTime(now)
	if !ok {
		c.resetLocked("Time computation overflowed. params = %+v, now = %v.", c.params, now)
		now, err := c.ref.Syscall()
		c.mu.RUnlock()
		return int64(now), err
	}
	c.mu.RUnlock()
	return v, nil
}
func ( c * CalibratedClock ) GetTime ( ) ( int64 , error ) { c . mu . RLock ( ) if ! c . ready { now , err := c . ref . Syscall ( ) c . mu . RUnlock ( ) return int64 ( now ) , err } now := c . ref . Cycles ( ) v , ok := c . params . ComputeTime ( now ) if ! ok { c . resetLocked ( " " , c . params , now ) now , err := c . ref . Syscall ( ) c . mu . RUnlock ( ) return int64 ( now ) , err } c . mu . RUnlock ( ) return v , nil }
GetTime returns the current time based on the clock calibration.
GetTime returns the current time based on the clock calibration .
// Fallback to a syscall. // Something is seriously wrong with the clock. Try // again with syscalls.