From 115a8b2b9d64daf65d93687a11516262b1c34d6f Mon Sep 17 00:00:00 2001 From: Dima Marhitych Date: Sat, 21 Oct 2023 19:31:22 +0200 Subject: [PATCH] v0.1.3: added GetFps --- init.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.go b/init.go index 9f51f50..c20070f 100644 --- a/init.go +++ b/init.go @@ -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")