// See cairo_device_observer_paint_elapsed().
//
// C API documentation: http://cairographics.org/manual/cairo-cairo-device-t.html#cairo-device-observer-paint-elapsed
359255
func (device *Device) ObserverPaintElapsed() float64 {
	ret := float64(C.cairo_device_observer_paint_elapsed(device.Ptr))
	if err := device.status(); err != nil {
		panic(err)
	}
	return ret
}
537826
func NewTimeDecider(timesource timesrc.TimeSource, remainingTimeThreshold time.Duration) oracle.OracleSource {
	return &timedecider{timesource, remainingTimeThreshold}
}
135977
func (device *Device) ObserverElapsed() float64 {
	ret := float64(C.cairo_device_observer_elapsed(device.Ptr))
	if err := device.status(); err != nil {
		panic(err)
	}
	return ret
}
957018
func (device *Device) Flush() {
	C.cairo_device_flush(device.Ptr)
	if err := device.status(); err != nil {
		panic(err)
	}
}
302077
func monitorTty(client *docker.Client, containerID string, terminalFd uintptr) {
	resizeTty(client, containerID, terminalFd)

	sigchan := make(chan os.Signal, 1)
	gosignal.Notify(sigchan, syscall.SIGWINCH)
	go func() {
		for _ = range sigchan {
			resizeTty(client, containerID, terminalFd)
		}
	}()
}
1275540
func (surface *XlibSurface) GetDrawable() uint64 {
	ret := uint64(C.cairo_xlib_surface_get_drawable(surface.Ptr))
	if err := surface.status(); err != nil {
		panic(err)
	}
	return ret
}
1018009
func (device *Device) ObserverStrokeElapsed() float64 {
	ret := float64(C.cairo_device_observer_stroke_elapsed(device.Ptr))
	if err := device.status(); err != nil {
		panic(err)
	}
	return ret
}
893200
func (m mathUtil) RadianAdd(base, delta float64) float64 {
	value := base + delta
	if value > _2pi {
		return math.Mod(value, _2pi)
	} else if value < 0 {
		return math.Mod(_2pi+value, _2pi)
	}
	return value
}
477920
func (c *baseFlowController) maybeAdjustWindowSize() {
	bytesReadInEpoch := c.bytesRead - c.epochStartOffset
	// don't do anything if less than half the window has been consumed
	if bytesReadInEpoch <= c.receiveWindowSize/2 {
		return
	}
	rtt := c.rttStats.SmoothedRTT()
	if rtt == 0 {
		return
	}

	fraction := float64(bytesReadInEpoch) / float64(c.receiveWindowSize)
	if time.Since(c.epochStartTime) < time.Duration(4*fraction*float64(rtt)) {
		// window is consumed too fast, try to increase the window size
		c.receiveWindowSize = utils.MinByteCount(2*c.receiveWindowSize, c.maxReceiveWindowSize)
	}
	c.startNewAutoTuningEpoch()
}
178367
func ElapsedMemory() (ret string) {
	memStat := new(runtime.MemStats)
	runtime.ReadMemStats(memStat)
	ret = FormatByte(memStat.Alloc, 3)
	return
}
1335319
func (h *Timing) DOMInteractiveTime(dOMInteractiveTime int64) *Timing {
	h.dOMInteractiveTime = dOMInteractiveTime
	h.dOMInteractiveTimeSet = true
	return h
}
484177
func (imd *IMDraw) Ellipse(radius pixel.Vec, thickness float64) {
	if thickness == 0 {
		imd.fillEllipseArc(radius, 0, 2*math.Pi)
	} else {
		imd.outlineEllipseArc(radius, 0, 2*math.Pi, thickness, false)
	}
}
735892
func (cr *Context) StrokePreserve() {
	C.cairo_stroke_preserve(cr.Ptr)
	if err := cr.status(); err != nil {
		panic(err)
	}
}
986892
func NewTimer() Timer {
	if !Enabled {
		return NilTimer{}
	}
	return &StandardTimer{
		histogram: NewHistogram(NewExpDecaySample(1028, 0.015)),
		meter:     NewMeter(),
	}
}
963680
func ElapsedIn(ms time.Time, diff time.Time) int64 {
	return diff.UTC().Sub(ms.UTC()).Nanoseconds() / 1e6
}
22390
func (s *Stopwatch) Elapsed() time.Duration {
	s.RLock()
	defer s.RUnlock()

	return s.elapsed() // Can I do this?
}
551943
func mobileDraw(defaultScene Scene) {
	if !initalized {
		var ctx mgl.Context
		ctx, worker = mgl.NewContext()
		Gl = gl.NewContext(ctx)
	}
	<-drawEvent
	defer func() {
		drawDone <- struct{}{}
	}()

	if !initalized {
		RunPreparation(defaultScene)
		ticker = time.NewTicker(time.Duration(int(time.Second) / opts.FPSLimit))
		initalized = true
	}

	select {
	case <-ticker.C:
	case <-resetLoopTicker:
		ticker.Stop()
		ticker = time.NewTicker(time.Duration(int(time.Second) / opts.FPSLimit))
	}
	Time.Tick()
	if !opts.HeadlessMode {
		Input.update()
	}
	// Then update the world and all Systems
	currentUpdater.Update(Time.Delta())
	Input.Mouse.Action = Neutral
}