// GetElapsedTime returns the Elapsed Time Option value, as described in RFC
// 3315, Section 22.9.
//
// The time.Duration returned reports the time elapsed during a DHCP
// transaction, as reported by a client.
357948
func GetElapsedTime(o dhcp6.Options) (ElapsedTime, error) {
	v, err := o.GetOne(dhcp6.OptionElapsedTime)
	if err != nil {
		return 0, err
	}

	var t ElapsedTime
	err = (&t).UnmarshalBinary(v)
	return t, err
}
649295
func (c *Context) GetDuration(key string) (d time.Duration) {
	if val, ok := c.Get(key); ok && val != nil {
		d, _ = val.(time.Duration)
	}
	return
}
680048
func (c *ConfigLookup) GetDuration(key string) time.Duration {
	value, ok := c.Lookup(key)
	if !ok {
		return 0
	}
	return cast.ToDuration(value)
}
1263027
func (c *Certificate) GetExpirationDuration() time.Duration {
	if err := c.buildX509Certificate(); err != nil {
		return time.Unix(0, 0).Sub(time.Now())
	}
	return c.crt.NotAfter.Sub(time.Now())
}
558042
func (d *Domain) GetTime(flags uint32) (int64, uint, error) {
	if C.LIBVIR_VERSION_NUMBER < 1002005 {
		return 0, 0, makeNotImplementedError("virDomainGetTime")
	}
	var secs C.longlong
	var nsecs C.uint
	var err C.virError
	ret := C.virDomainGetTimeWrapper(d.ptr, &secs, &nsecs, C.uint(flags), &err)
	if ret == -1 {
		return 0, 0, makeError(&err)
	}

	return int64(secs), uint(nsecs), nil
}
1295480
func ParseDateTime(val string) time.Time {
	t, err := time.Parse(DateTimeFormat, val)
	if err != nil {
		return time.Time{}
	}

	return t
}
22390
func (s *Stopwatch) Elapsed() time.Duration {
	s.RLock()
	defer s.RUnlock()

	return s.elapsed() // Can I do this?
}
973366
func (s *Stopwatch) AddElapsedSince(t time.Time) {
	s.Lock()
	defer s.Unlock()

	s.elapsedTime += time.Since(t)
}
450065
func EndpointCorrelationSleepTime(try int) time.Duration {
	return time.Duration(try) * time.Second
}
1002020
func GetUptime(query map[string]string, lastModifiedSince string) (*Uptime, string, error) {
	uptime := new(Uptime)

	if lastModified, err := executeRequest("uptime", query, lastModifiedSince, &uptime); err != nil {
		return nil, "", err
	} else {
		return uptime, lastModified, nil
	}
}
1358106
func (c *TsCell) GetTimeValue() time.Time {
	ts := c.cell.GetTimestampValue()
	s := ts / int64(1000)
	ms := time.Duration(ts%int64(1000)) * time.Millisecond
	return time.Unix(s, ms.Nanoseconds())
}
114427
func OptionsLeaseTime(d time.Duration) []byte {
	leaseBytes := make([]byte, 4)
	binary.BigEndian.PutUint32(leaseBytes, uint32(d/time.Second))
	return leaseBytes
}
798794
func (db *WiredDB) GetMempoolPriceCountTime() *apitypes.PriceCountTime {
	return db.MPC.GetTicketPriceCountTime(int(db.params.MaxFreshStakePerBlock))
}
188182
func (s *CancelResizeOutput) SetElapsedTimeInSeconds(v int64) *CancelResizeOutput {
	s.ElapsedTimeInSeconds = &v
	return s
}
327037
func getModTime(path string) (t time.Time, err *probe.Error) {
	var e error
	path, e = filepath.EvalSymlinks(path)
	if e != nil {
		return t, probe.NewError(fmt.Errorf("Unable to get absolute path of %s. %s", path, e))
	}

	// Version is mc non-standard, we will use mc binary's
	// ModTime as release time.
	var fi os.FileInfo
	fi, e = os.Stat(path)
	if e != nil {
		return t, probe.NewError(fmt.Errorf("Unable to get ModTime of %s. %s", path, e))
	}

	// Return the ModTime
	return fi.ModTime().UTC(), nil
}
1140385
func (s *RestoreStatus) SetElapsedTimeInSeconds(v int64) *RestoreStatus {
	s.ElapsedTimeInSeconds = &v
	return s
}
528203
func translateTimerAttributes(d time.Duration) (attrs map[string]interface{}) {
	attrs = make(map[string]interface{})
	attrs[DisplayTransform] = fmt.Sprintf("x/%d", int64(d))
	attrs[DisplayUnitsShort] = string(unitRegexp.Find([]byte(d.String())))
	return
}