Changeset - fe3b8ad915af
[Not reviewed]
default
0 1 0
Drew Perttula - 19 years ago 2006-06-16 16:59:04
drewp@bigasterisk.com
fix __float__ to always return a float, for dmxserver
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/updatefreq.py
Show inline comments
 
"""calculates your updates-per-second"""
 

	
 
from __future__ import division
 
import time
 

	
 
class Updatefreq:
 
@@ -27,7 +28,7 @@ class Updatefreq:
 
        try:
 
            hz=len(self.times)/(self.times[-1]-self.times[0])
 
        except ZeroDivisionError:
 
            return 0
 
            return 0.0
 
        return hz
 
    def __str__(self):
 
        return "%.2fHz"%float(self)
0 comments (0 inline, 0 general)