ui/app: round total and cpu times

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-05-13 21:41:28 +02:00
parent 3c9c38947d
commit a6fc2b6d45
+2 -1
View File
@@ -138,7 +138,8 @@ func (w *Window) Draw(root *ui.Ops) {
frameDur = frameDur.Truncate(100 * time.Microsecond)
w.lastFrame = now
if w.Profiling {
w.timings = fmt.Sprintf("tot:%7s cpu:%7s %s", frameDur, drawDur, w.gpu.Timings())
q := 100 * time.Microsecond
w.timings = fmt.Sprintf("tot:%7s cpu:%7s %s", frameDur.Round(q), drawDur.Round(q), w.gpu.Timings())
w.setNextFrame(time.Time{})
}
w.reader.Reset(root.Data(), root.Refs())