summaryrefslogtreecommitdiff
path: root/tools/certtools.py
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2014-10-27 14:37:01 +0100
committerMagnus Ahltorp <map@kth.se>2014-10-27 14:37:01 +0100
commit91e5b7f4b85cdbc399ccaa1bb1d813e0d829f3d5 (patch)
tree74a965889bd723b849c87e6c974c85368e2238d7 /tools/certtools.py
parent7fd299ab23beee422789f679a35c9526c54fb1fb (diff)
submitcert.py: submit multiple cert chains
Diffstat (limited to 'tools/certtools.py')
-rw-r--r--tools/certtools.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/certtools.py b/tools/certtools.py
index 8d64ee4..7b901cf 100644
--- a/tools/certtools.py
+++ b/tools/certtools.py
@@ -10,6 +10,7 @@ import struct
import sys
import hashlib
import ecdsa
+import datetime
publickeys = {
"https://ct.googleapis.com/pilot/":
@@ -204,3 +205,16 @@ def get_leaf_hash(merkle_tree_leaf):
leaf_hash.update(merkle_tree_leaf)
return leaf_hash.digest()
+
+def timing_point(timer_dict=None, name=None):
+ t = datetime.datetime.now()
+ if timer_dict:
+ starttime = timer_dict["lasttime"]
+ stoptime = t
+ deltatime = stoptime - starttime
+ timer_dict["deltatimes"].append((name, deltatime.seconds * 1000000 + deltatime.microseconds))
+ timer_dict["lasttime"] = t
+ return None
+ else:
+ timer_dict = {"deltatimes":[], "lasttime":t}
+ return timer_dict