Skip to content

Commit 6f9237c

Browse files
committed
When $*DEBUG set, show Widget.full-refresh timing info
1 parent b56c211 commit 6f9237c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Terminal/Widgets/Widget.rakumod

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,15 @@ class Terminal::Widgets::Widget
342342

343343
#| Fully refresh this widget and optionally force a print
344344
method full-refresh(Bool:D :$print = True) {
345+
my $debug = +($*DEBUG // 0);
346+
my $t0 = now;
347+
345348
self.clear-frame;
346349
self.draw-frame;
347350
self.composite(:$print);
351+
352+
note sprintf(" ⏱️ Full Refresh {self.gist-name}: %.3fms", 1000 * (now - $t0))
353+
if $debug;
348354
}
349355

350356
#| Clear the frame and set it all-dirty (so it requires composite)

0 commit comments

Comments
 (0)