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,
209 mean_interval=None, stddev=None):
212 if not max_interval
and not min_interval
and not mean_interval
and not stddev:
219 max_interval[0] = 0.0
220 min_interval[0] = ULLONG_MAX
229 for i
in range(len_):
230 trecord_ = self.
_record[i].toDouble()
232 sq_sum_ += (trecord_ * trecord_)
234 if trecord_ > max_interval[0]:
235 max_interval[0] = trecord_
237 if trecord_ < min_interval[0]:
238 min_interval[0] = trecord_
241 mean_interval[0] = sum_ / len_
242 stddev[0] = math.sqrt(sq_sum_ / len_ - (mean_interval[0] * mean_interval[0]))
248 def __init__(self, max=None, min=None, mean=None, stdd=None):
249 if not max
and not min
and not mean
and not stdd:
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.