View Single Post
  #11  
Old 06-18-2004, 10:37 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Yo, what up dizzle,

No there's no built-in way to get the frame-rate reading. Here's a sample script that manually calculates the framerate:
Code:
import viz
import time
viz.go()

HISTORY_SIZE = 30
framerate = []

def mytimer(num):
	framerate.append(time.clock())
	if len(framerate) > HISTORY_SIZE:
		del framerate[0]

	rate = len(framerate) / (framerate[-1] - framerate[0])

viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.001,viz.FOREVER)
word
Reply With Quote