A class to manage real algorithm timing
Definition at line 74 of file precedence.py.
◆ __init__()
def precedence.RealTimeValue.__init__ |
( |
|
self, |
|
|
|
path, |
|
|
|
defaultTime, |
|
|
|
factor = 1 |
|
) |
| |
defaultTime -- run time, assigned to an algorithm if no time is found in provided timing library
(and it will also be scaled by the 'factor' argument)
Definition at line 77 of file precedence.py.
77 def __init__(self, path, defaultTime, factor=1):
79 defaultTime -- run time, assigned to an algorithm if no time is found in provided timing library
80 (and it will also be scaled by the 'factor' argument)
85 self.defaultTime = defaultTime
88 self.file = open(self.path)
89 self.timings = json.load(self.file)
◆ get()
def precedence.RealTimeValue.get |
( |
|
self, |
|
|
|
algoName = "" |
|
) |
| |
Get time for a given algorithm name
Definition at line 91 of file precedence.py.
91 def get(self, algoName=""):
92 """Get time for a given algorithm name"""
94 if algoName
in self.timings:
95 time = float(self.timings[algoName])
97 capAlgoName = algoName[0].upper() + algoName[1 : len(algoName)]
99 if capAlgoName
in self.timings:
100 time = float(self.timings[capAlgoName])
102 time = self.defaultTime
104 "WARNING: Timing for %s (or %s) not found in the provided library, using default one: %s"
105 % (algoName, capAlgoName, time)
108 time = time * self.factor
110 return time, self.varRuntime
◆ defaultTime
precedence.RealTimeValue.defaultTime |
◆ factor
precedence.RealTimeValue.factor |
◆ file
precedence.RealTimeValue.file |
◆ path
precedence.RealTimeValue.path |
◆ timings
precedence.RealTimeValue.timings |
◆ varRuntime
precedence.RealTimeValue.varRuntime |
The documentation for this class was generated from the following file: