From: Naoki Kambe Date: Tue, 15 Jan 2013 08:07:40 +0000 (+0900) Subject: [2225_statistics] Revert "[2225_statistics] use timedelta.total_seconds() instead... X-Git-Tag: bind10-1.1.0beta1-release~72^2~40^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28a20a3ee754d03ea90f13f76fa8e6d44c696b69;p=thirdparty%2Fkea.git [2225_statistics] Revert "[2225_statistics] use timedelta.total_seconds() instead of redundant computation" This reverts commit 31b16f3568b95073fc15b68e435215572f25c5b8. This is because timedelta.total_seconds() is not supported yet on Python3.1. --- diff --git a/src/lib/python/isc/statistics/counters.py b/src/lib/python/isc/statistics/counters.py index d824bda72c..8da0b1e8b5 100644 --- a/src/lib/python/isc/statistics/counters.py +++ b/src/lib/python/isc/statistics/counters.py @@ -126,7 +126,8 @@ def _stop_timer(start_time, element, spec, identifier): the element, which is in seconds between start_time and the current time and is float-type.""" delta = datetime.now() - start_time - sec = delta.total_seconds() + sec = round(delta.days * 86400 + delta.seconds + \ + delta.microseconds * 1E-6, 6) _set_counter(element, spec, identifier, sec) def _concat(*args, sep='/'):