Skip to content

Commit

Permalink
v0.1.3: added GetFps
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Oct 21, 2023
1 parent 2c16a4f commit 115a8b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func SetFps(fps int) {
fpsInterval = time.Second / time.Duration(fps)
}

func GetFps() float64 {
return float64(time.Second) / float64(fpsInterval)
}

func clearCanvas() {
canvas := document.GetElementById("webzen")
context := canvas.GetContext("2d")
Expand Down

0 comments on commit 115a8b2

Please sign in to comment.