MCPcopy
hub / github.com/EngoEngine/engo / Tick

Method Tick

clock.go:51–65  ·  view source on GitHub ↗

Tick indicates a new tick/frame has occurred.

()

Source from the content-addressed store, hash-verified

49
50// Tick indicates a new tick/frame has occurred.
51func (c *Clock) Tick() {
52 currStamp := theTimer.Now()
53
54 c.counter++
55
56 c.deltaStamp = currStamp - c.frameStamp
57 c.frameStamp = currStamp
58
59 c.elapsStamp += c.deltaStamp
60 if secondsInNano <= c.elapsStamp {
61 c.elapsStamp %= secondsInNano
62 c.perSecond = c.counter
63 c.counter = 0
64 }
65}
66
67// Delta is the amount of seconds between the last tick and the one before that
68func (c *Clock) Delta() float32 {

Callers 15

TestClockTickFunction · 0.95
TestClockFPSFunction · 0.95
TestClockDeltaFunction · 0.95
TestClockPauseFunction · 0.95
mobileDrawFunction · 0.80
runLoopFunction · 0.80
RunIterationFunction · 0.80
RunIterationFunction · 0.80
runLoopFunction · 0.80
RunIterationFunction · 0.80
runLoopFunction · 0.80
RunIterationFunction · 0.80

Calls 1

NowMethod · 0.65

Tested by 4

TestClockTickFunction · 0.76
TestClockFPSFunction · 0.76
TestClockDeltaFunction · 0.76
TestClockPauseFunction · 0.76