From 5313b0e899deacb80c0496b6ea1ad0c402e5a28a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 15 Sep 2017 13:20:35 +0200 Subject: [PATCH] Warnings: LXDebug::log_time --- SL/LXDebug.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/LXDebug.pm b/SL/LXDebug.pm index 707b89230..7dddf2a02 100644 --- a/SL/LXDebug.pm +++ b/SL/LXDebug.pm @@ -348,7 +348,10 @@ sub log_time { return 1 unless want_request_timer(); my $now = $self->get_request_time; - my $diff = int((($now - ($self->{previous_log_time} // 0)) * 10_000 + 5) / 10); + + return 1 unless $now; + + my $diff = $self->{previous_log_time} ? int((($now - ($self->{previous_log_time} // 0)) * 10_000 + 5) / 10) : $now * 10_0000 + 5; $self->{previous_log_time} = $now; $self->_write("time", "${now}s Δ ${diff}ms" . (@slurp ? " (@slurp)" : '')); -- 2.20.1