27 ULLONG_MAX = 0xffffffffffffffff
34 usec_per_sec = 1000000
71 tm_f = float(tm - long(tm))
72 self.
sec = long(tm - tm_f)
73 self.
usec = long(float(tm_f) * float(usec_per_sec))
97 if self.
sec >= tm.sec:
98 if self.
usec >= tm.usec:
99 res.sec = self.
sec - tm.sec
100 res.usec = self.
usec - tm.usec
102 res.sec = self.
sec - tm.sec - 1
103 res.usec = (self.
usec + usec_per_sec) - tm.usec
105 if tm.usec >= self.
usec:
106 res.sec = -(tm.sec - self.
sec)
107 res.usec = -(tm.usec - self.
usec)
109 res.sec = -(tm.sec - self.
sec - 1)
110 res.usec = -(tm.usec + usec_per_sec) + self.
usec 117 tm_f = float(tm - long(tm))
118 self.
sec = long(float(tm) - float(tm_f))
119 self.
usec = long(float(tm_f) * float(usec_per_sec))
168 if self._begin.sec() == 0:
208 def getStatistics(self, max_interval=None, min_interval=None, mean_interval=
None, stddev=
None):
211 if not max_interval
and not min_interval
and not mean_interval
and not stddev:
218 max_interval[0] = 0.0
219 min_interval[0] = ULLONG_MAX
228 for i
in range(len_):
229 trecord_ = self.
_record[i].toDouble()
231 sq_sum_ += (trecord_ * trecord_)
233 if trecord_ > max_interval[0]:
234 max_interval[0] = trecord_
236 if trecord_ < min_interval[0]:
237 min_interval[0] = trecord_
240 mean_interval[0] = sum_ / len_
241 stddev[0] = math.sqrt(sq_sum_ / len_ - (mean_interval[0] * mean_interval[0]))
247 def __init__(self, max=None, min=None, mean=None, stdd=None):
248 if not max
and not min
and not mean
and not stdd:
260 def getStatistics(self, max_interval=None, min_interval=None, mean_interval=None, stddev=None)
Get total statistics.
def __init__(self)
Constructor.
def tick(self)
Begin time measurement for time statistics.
def __init__(self, max=None, min=None, mean=None, stdd=None)
def count(self)
Get number of time measurement buffer.
def tack(self)
Finish time measurement for time statistics.
def __init__(self, buflen=100)
Time statictics object for profiling.