MCPcopy Index your code
hub / github.com/EngoEngine/engo / NewClock

Function NewClock

clock.go:41–48  ·  view source on GitHub ↗

NewClock creates a new timer which allows you to measure ticks per seconds. Be sure to call `Tick()` whenever you want a tick to occur - it does not automatically tick each frame.

()

Source from the content-addressed store, hash-verified

39// NewClock creates a new timer which allows you to measure ticks per seconds. Be sure to call `Tick()` whenever you
40// want a tick to occur - it does not automatically tick each frame.
41func NewClock() *Clock {
42 currStamp := theTimer.Now()
43
44 clock := new(Clock)
45 clock.frameStamp = currStamp
46 clock.startStamp = currStamp
47 return clock
48}
49
50// Tick indicates a new tick/frame has occurred.
51func (c *Clock) Tick() {

Callers 12

RunPreparationFunction · 0.85
RunPreparationFunction · 0.85
RunPreparationFunction · 0.85
RunPreparationFunction · 0.85
RunPreparationFunction · 0.85
RunPreparationFunction · 0.85
TestClockTickFunction · 0.85
TestClockFPSFunction · 0.85
TestClockDeltaFunction · 0.85
TestClockTimeFunction · 0.85
TestClockPauseFunction · 0.85
RunPreparationFunction · 0.85

Calls 1

NowMethod · 0.65

Tested by 5

TestClockTickFunction · 0.68
TestClockFPSFunction · 0.68
TestClockDeltaFunction · 0.68
TestClockTimeFunction · 0.68
TestClockPauseFunction · 0.68