Documentation
¶
Overview ¶
Package startuptime shares startup milestones between the game loop, asset groups, and development tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarkFirstGroup ¶
MarkFirstGroup records the load duration of the first assets.Group that finishes loading.
func MarkFirstUpdate ¶
func MarkFirstUpdate()
MarkFirstUpdate records the first completed update callback.
Types ¶
type Mark ¶
Mark is the elapsed time to a recorded startup milestone.
On native targets each milestone is measured from Go package initialization. On the web, when the browser exposes performance.timeOrigin and performance.now(), milestones are measured from navigation start so Wasm download and compilation are included, and Snapshot.GoInit records when Go package initialization ran.
type Snapshot ¶
type Snapshot struct {
// GoInit is the elapsed time from navigation start to Go package
// initialization. Recorded is false when no navigation origin is available.
GoInit Mark
// FirstUpdate is the elapsed time to the first completed game.Loop.Update callback.
FirstUpdate Mark
// FirstDraw is the elapsed time to the first completed game.Loop.Draw callback.
FirstDraw Mark
// Playable is the elapsed time to the first gamedebug.MarkPlayable call.
Playable Mark
// FirstGroup is the load duration of the first assets.Group that completed loading.
FirstGroup Mark
// FirstGroupName is the name of the first assets.Group that completed loading.
FirstGroupName string
}
Snapshot contains the first occurrence of each startup milestone.