## [Pycrypto-checkins] [ pycrypto-Bugs-627645 ] measureTickSize() can fail from low res

 [Pycrypto-checkins] [ pycrypto-Bugs-627645 ] measureTickSize() can fail from low res From: SourceForge.net - 2003-02-28 14:29:52 ```Bugs item #627645, was opened at 2002-10-23 15:01 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: A.M. Kuchling (akuchling) Summary: measureTickSize() can fail from low res Initial Comment: if the resolution is really low, this function failed to find a valid interval. here's how i fixed it. def _measureTickSize(self): # _measureTickSize() tries to estimate a rough average of the # resolution of time that you can see from Python. It does # this by measuring the time 100 times, computing the delay # between measurements, and taking the median of the resulting # list. interval = [0] * 100 # Compute 100 differences t=time.time() for i in range(0,100): t2=time.time() delta=int((t2-t)*1e6) t=t2 if delta: interval[i] = delta # Take the median of the array of intervals avg = reduce(lambda x, y: x+y, interval) avg = ((avg+1)/len(interval))+1 self._ticksize=avg ---------------------------------------------------------------------- Comment By: Robert Olson (olson) Date: 2002-11-06 11:29 Message: Logged In: YES user_id=20112 I ran into this as well on Windows. My solution was to use time.clock() instead of time.time() on windows; time.clock() uses the windows hires clocks and works great for this. I've submitted patch 634515 for this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 ```

 [Pycrypto-checkins] [ pycrypto-Bugs-627645 ] measureTickSize() can fail from low res From: - 2002-10-23 19:12:06 ```Bugs item #627645, was opened at 2002-10-23 12:01 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: measureTickSize() can fail from low res Initial Comment: if the resolution is really low, this function failed to find a valid interval. here's how i fixed it. def _measureTickSize(self): # _measureTickSize() tries to estimate a rough average of the # resolution of time that you can see from Python. It does # this by measuring the time 100 times, computing the delay # between measurements, and taking the median of the resulting # list. interval = [0] * 100 # Compute 100 differences t=time.time() for i in range(0,100): t2=time.time() delta=int((t2-t)*1e6) t=t2 if delta: interval[i] = delta # Take the median of the array of intervals avg = reduce(lambda x, y: x+y, interval) avg = ((avg+1)/len(interval))+1 self._ticksize=avg ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 ```
 [Pycrypto-checkins] [ pycrypto-Bugs-627645 ] measureTickSize() can fail from low res From: - 2002-11-06 16:29:59 ```Bugs item #627645, was opened at 2002-10-23 14:01 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: measureTickSize() can fail from low res Initial Comment: if the resolution is really low, this function failed to find a valid interval. here's how i fixed it. def _measureTickSize(self): # _measureTickSize() tries to estimate a rough average of the # resolution of time that you can see from Python. It does # this by measuring the time 100 times, computing the delay # between measurements, and taking the median of the resulting # list. interval = [0] * 100 # Compute 100 differences t=time.time() for i in range(0,100): t2=time.time() delta=int((t2-t)*1e6) t=t2 if delta: interval[i] = delta # Take the median of the array of intervals avg = reduce(lambda x, y: x+y, interval) avg = ((avg+1)/len(interval))+1 self._ticksize=avg ---------------------------------------------------------------------- Comment By: Robert Olson (olson) Date: 2002-11-06 10:29 Message: Logged In: YES user_id=20112 I ran into this as well on Windows. My solution was to use time.clock() instead of time.time() on windows; time.clock() uses the windows hires clocks and works great for this. I've submitted patch 634515 for this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 ```
 [Pycrypto-checkins] [ pycrypto-Bugs-627645 ] measureTickSize() can fail from low res From: SourceForge.net - 2003-02-28 14:29:52 ```Bugs item #627645, was opened at 2002-10-23 15:01 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: A.M. Kuchling (akuchling) Summary: measureTickSize() can fail from low res Initial Comment: if the resolution is really low, this function failed to find a valid interval. here's how i fixed it. def _measureTickSize(self): # _measureTickSize() tries to estimate a rough average of the # resolution of time that you can see from Python. It does # this by measuring the time 100 times, computing the delay # between measurements, and taking the median of the resulting # list. interval = [0] * 100 # Compute 100 differences t=time.time() for i in range(0,100): t2=time.time() delta=int((t2-t)*1e6) t=t2 if delta: interval[i] = delta # Take the median of the array of intervals avg = reduce(lambda x, y: x+y, interval) avg = ((avg+1)/len(interval))+1 self._ticksize=avg ---------------------------------------------------------------------- Comment By: Robert Olson (olson) Date: 2002-11-06 11:29 Message: Logged In: YES user_id=20112 I ran into this as well on Windows. My solution was to use time.clock() instead of time.time() on windows; time.clock() uses the windows hires clocks and works great for this. I've submitted patch 634515 for this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 ```
 [Pycrypto-checkins] [ pycrypto-Bugs-627645 ] measureTickSize() can fail from low res From: SourceForge.net - 2003-03-10 19:43:52 ```Bugs item #627645, was opened at 2002-10-23 15:01 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: A.M. Kuchling (akuchling) Summary: measureTickSize() can fail from low res Initial Comment: if the resolution is really low, this function failed to find a valid interval. here's how i fixed it. def _measureTickSize(self): # _measureTickSize() tries to estimate a rough average of the # resolution of time that you can see from Python. It does # this by measuring the time 100 times, computing the delay # between measurements, and taking the median of the resulting # list. interval = [0] * 100 # Compute 100 differences t=time.time() for i in range(0,100): t2=time.time() delta=int((t2-t)*1e6) t=t2 if delta: interval[i] = delta # Take the median of the array of intervals avg = reduce(lambda x, y: x+y, interval) avg = ((avg+1)/len(interval))+1 self._ticksize=avg ---------------------------------------------------------------------- >Comment By: A.M. Kuchling (akuchling) Date: 2003-03-10 14:55 Message: Logged In: YES user_id=11375 Believed fixed in 1.9alpha5. ---------------------------------------------------------------------- Comment By: Robert Olson (olson) Date: 2002-11-06 11:29 Message: Logged In: YES user_id=20112 I ran into this as well on Windows. My solution was to use time.clock() instead of time.time() on windows; time.clock() uses the windows hires clocks and works great for this. I've submitted patch 634515 for this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=120937&aid=627645&group_id=20937 ```