aboutsummaryrefslogtreecommitdiff
path: root/benchmark.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2018-07-20 14:17:04 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2018-07-20 14:17:04 +0200
commit78098dbe189ae84b38cf6c94cbe06dafd07cb10c (patch)
treea637cc1cc44dd3f0ddce3a47e9887bb546774adb /benchmark.py
parent08cdc1d18cd8371b38ef1a6bf663ca32bb951c9e (diff)
downloadallocbench-78098dbe189ae84b38cf6c94cbe06dafd07cb10c.tar.gz
allocbench-78098dbe189ae84b38cf6c94cbe06dafd07cb10c.zip
make results independant and add cmdline options
Diffstat (limited to 'benchmark.py')
-rw-r--r--benchmark.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/benchmark.py b/benchmark.py
new file mode 100644
index 0000000..9b7316a
--- /dev/null
+++ b/benchmark.py
@@ -0,0 +1,15 @@
+import pickle
+
+class Benchmark (object):
+ def save(self, verbose=False):
+ if verbose:
+ print("Saving results to:", self.file_name + ".save")
+ with open(self.file_name + ".save", "wb") as f:
+ pickle.dump(self.results, f)
+
+ def load(self, verbose=False):
+ if verbose:
+ print("Loading results from:", self.file_name + ".save")
+ with open(self.file_name + ".save", "rb") as f:
+ self.results = pickle.load(f)
+