~f4814n/frost

03d6b5ad3c19082b3ef083ba019c99c85275a2ac — Fabian Geiselhart 3 months ago 486f96b
app: Log when <60FPS
1 files changed, 10 insertions(+), 1 deletions(-)

M cmd/frost/app.go
M cmd/frost/app.go => cmd/frost/app.go +10 -1
@@ 2,6 2,7 @@ package main

import (
	"net/http"
	"time"

	"golang.org/x/exp/shiny/materialdesign/icons"



@@ 14,6 15,7 @@ import (
	"gioui.org/unit"
	"gioui.org/widget"
	"gioui.org/widget/material"
	"gioui.org/x/component"
	"git.sr.ht/~f4814n/frost"
	"git.sr.ht/~f4814n/frost/component/cache"
	"git.sr.ht/~f4814n/frost/component/sync"


@@ 25,7 27,6 @@ import (
	"git.sr.ht/~f4814n/frost/view/roomlist"
	fwidget "git.sr.ht/~f4814n/frost/widget"
	"git.sr.ht/~f4814n/matrix"
	"gioui.org/x/component"
	"go.uber.org/zap"
)



@@ 177,6 178,14 @@ func (a *App) handleEvents() error {
				return a.modalLayer.Layout(gtx, a.theme)
			})
			e.Frame(gtx.Ops)

			dur := time.Since(gtx.Now)
			if dur > time.Second/60 {
				a.logger.Warn("Not rendering fast enough for 60 FPS",
					zap.String("time", dur.String()),
					zap.Float64("fps", 1/dur.Seconds()),
				)
			}
		}
	case e := <-a.rx:
		switch e := e.(type) {