Browse Source

[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.
Naoki Kambe 12 years ago
parent
commit
28a20a3ee7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/lib/python/isc/statistics/counters.py

+ 2 - 1
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='/'):