// See also https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetTime
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
}
1251696
func (k *Key) Time() (time.Time, error) {
	return k.TimeFormat(time.RFC3339)
}
722587
func Time() gopter.Gen {
	return func(genParams *gopter.GenParameters) *gopter.GenResult {
		sec := genParams.Rng.Int63n(253402214400) // Ensure year in [0, 9999]
		usec := genParams.Rng.Int63n(1000000000)

		return gopter.NewGenResult(time.Unix(sec, usec), TimeShrinker)
	}
}
1168790
func (h *Timing) ContentLoadTime(contentLoadTime int64) *Timing {
	h.contentLoadTime = contentLoadTime
	h.contentLoadTimeSet = true
	return h
}
286892
func compileTime() time.Time {
	info, err := os.Stat(os.Args[0])
	if err != nil {
		return time.Now()
	}
	return info.ModTime()
}
29488
func (d DateTime) Time(v reflect.Value) (interface{}, error) {
	return d.time(), nil
}
796477
func (d *Domain) GetIOThreadInfo(flags DomainModificationImpact) ([]DomainIOThreadInfo, error) {
	if C.LIBVIR_VERSION_NUMBER < 1002014 {
		return []DomainIOThreadInfo{}, makeNotImplementedError("virDomaingetIOThreadInfo")
	}
	var cinfolist **C.virDomainIOThreadInfo

	var err C.virError
	ret := C.virDomainGetIOThreadInfoWrapper(d.ptr, (**C.virDomainIOThreadInfoPtr)(unsafe.Pointer(&cinfolist)), C.uint(flags), &err)
	if ret == -1 {
		return []DomainIOThreadInfo{}, makeError(&err)
	}

	info := make([]DomainIOThreadInfo, int(ret))

	for i := 0; i < int(ret); i++ {
		cinfo := (*(**C.virDomainIOThreadInfo)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfolist)) + (unsafe.Sizeof(*cinfolist) * uintptr(i)))))

		ncpus := int(cinfo.cpumaplen * 8)
		cpumap := make([]bool, ncpus)
		for j := 0; j < ncpus; j++ {
			byte := j / 8
			bit := j % 8

			cpumapbyte := *(*C.uchar)(unsafe.Pointer(uintptr(unsafe.Pointer(cinfo.cpumap)) + (unsafe.Sizeof(*cinfo.cpumap) * uintptr(byte))))
			cpumap[j] = (cpumapbyte & (1 << uint(bit))) != 0
		}

		info[i] = DomainIOThreadInfo{
			IOThreadID: uint(cinfo.iothread_id),
			CpuMap:     cpumap,
		}

		C.virDomainIOThreadInfoFreeWrapper(cinfo)
	}
	C.free(unsafe.Pointer(cinfolist))

	return info, nil
}
822565
func webTime(t time.Time) string {
	ftime := t.Format(time.RFC1123)
	if strings.HasSuffix(ftime, "UTC") {
		ftime = ftime[0:len(ftime)-3] + "GMT"
	}
	return ftime
}
874702
func Time(ctx *cli.Context) command.Command {
	usage := "time"
	desc := "Returns the server time"

	return command.NewCommand("time", usage, desc, func(args ...string) ([]byte, error) {
		t := time.Now().Format(time.RFC1123)
		return []byte("Server time is: " + t), nil
	})
}
317622
func (h *Timing) PageLoadTime(pageLoadTime int64) *Timing {
	h.pageLoadTime = pageLoadTime
	h.pageLoadTimeSet = true
	return h
}
972649
func (t *StandardResettingTimer) Time(f func()) {
	ts := time.Now()
	f()
	t.Update(time.Since(ts))
}
546497
func InitialVirtualTime(t time.Time) setVirtualTimerPolicyOption {
	return func(p Params) {
		p["initialVirtualTime"] = float64(t.Unix())
	}
}
1143804
func getScope(t time.Time, region string) string {
	scope := strings.Join([]string{
		t.Format(yyyymmdd),
		region,
		string(serviceS3),
		"aws4_request",
	}, "/")
	return scope
}
871497
func (r Provisioning_Maintenance_Window) GetMaintenanceStartEndTime(ticketId *int) (resp datatypes.Provisioning_Maintenance_Window, err error) {
	params := []interface{}{
		ticketId,
	}
	err = r.Session.DoRequest("SoftLayer_Provisioning_Maintenance_Window", "getMaintenanceStartEndTime", params, &r.Options, &resp)
	return
}
235677
func (_class VMClass) GetSnapshotTime(sessionID SessionRef, self VMRef) (_retval time.Time, _err error) {
	_method := "VM.get_snapshot_time"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertVMRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertTimeToGo(_method + " -> ", _result.Value)
	return
}
782878
func (a *API) GetDomain(domain int) (*Domain, error) {
	dst := new(Domain)
	url := a.BuildURL("/v2/domain/%d", domain)
	err := a.Get(url, Params{}, dst)
	return dst, err
}
1172060
func (h *Timing) PageDownloadTime(pageDownloadTime int64) *Timing {
	h.pageDownloadTime = pageDownloadTime
	h.pageDownloadTimeSet = true
	return h
}