Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   High CPU utilization with Pylab (http://www.velocityreviews.com/forums/t732548-high-cpu-utilization-with-pylab.html)

Madhur 09-05-2010 10:05 AM

High CPU utilization with Pylab
 
I am trying to plot a runtime graph using pylab. But the very purpose
of functionality is lost because of high CPU percentage hogged by
plotting the graph.

Here is the piece of code which I have written.

def timerfunc(ulcm, dlcm):
count=0
xaxis=[]
yaxis=[]
ion()
while 1:
xaxis.append(count)
dr=(((dlcm.sum)/dlcm.timer)*8)
dlcm.counter=0
yaxis.append(dr)
dlcm.sum=0
h=plot(xaxis,yaxis,'b')
draw()
count=count+1
time.sleep(dlcm.timer/1000.0)
if (count>100):
xlim(count-100, count)

Here is the function which plots the graph.

Is there something which does not makes sense .?

-Madhur


All times are GMT. The time now is 02:01 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.