gpu,app: don't call time.Now when not profiling

runtime.nanotime1 shows up in profiles on Android, so avoid calling
time.Now when we can.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-03-11 19:22:08 +01:00
parent 317635b176
commit f19b16fecc
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -741,7 +741,10 @@ func (w *Window) processEvent(d driver, e event.Event) {
// No drawing if not visible.
break
}
frameStart := time.Now()
var frameStart time.Time
if w.queue.q.Profiling() {
frameStart = time.Now()
}
w.hasNextFrame = false
e2.Frame = w.update
e2.Queue = &w.queue