aboutsummaryrefslogtreecommitdiff
path: root/benchmark.py
blob: c68dce754cb59312d5ffd7cf8320b030f6d36b47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pickle

class Benchmark (object):
    def save(self, path=None, verbose=False):
        f = path if path else self.name + ".save"
        if verbose:
            print("Saving results to:", self.name + ".save")
        with open(f, "wb") as f:
            pickle.dump(self.results, f)

    def load(self, path=None, verbose=False):
        f = path if path else self.name + ".save"
        if verbose:
            print("Loading results from:", self.name + ".save")
        with open(f, "rb") as f:
            self.results = pickle.load(f)