projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dca6f34
)
LXDebug::log_time: Differenz zum letzten Aufruf in ms mit ausgeben
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 1 Jul 2014 12:05:44 +0000
(14:05 +0200)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Tue, 1 Jul 2014 12:06:05 +0000
(14:06 +0200)
SL/LXDebug.pm
patch
|
blob
|
history
diff --git
a/SL/LXDebug.pm
b/SL/LXDebug.pm
index
016015f
..
c2a7c59
100644
(file)
--- a/
SL/LXDebug.pm
+++ b/
SL/LXDebug.pm
@@
-304,7
+304,12
@@
sub end_request {
sub log_time {
my ($self, @slurp) = @_;
return 1 unless want_request_timer();
- $self->_write("time", $self->get_request_time() . (@slurp ? " (@slurp)" : ''));
+
+ my $now = $self->get_request_time;
+ my $diff = int((($now - ($self->{previous_log_time} // 0)) * 10_000 + 5) / 10);
+ $self->{previous_log_time} = $now;
+
+ $self->_write("time", "${now}s Δ ${diff}ms" . (@slurp ? " (@slurp)" : ''));
}
sub get_request_time {