High CPU utilization with Pylab

Discussion in 'Python' started by Madhur, Sep 5, 2010.

  1. Madhur

    Madhur Guest

    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
    Madhur, Sep 5, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mcollier

    w3wp.exe High CPU Utilization

    mcollier, Mar 11, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    60,910
    jeandemo
    Apr 13, 2011
  2. =?Utf-8?B?UGV0ZXI=?=

    KB # 840861 and 100% CPU utilization

    =?Utf-8?B?UGV0ZXI=?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    =?Utf-8?B?UGV0ZXI=?=
    Mar 9, 2006
  3. dm3281
    Replies:
    2
    Views:
    520
    bruce barker \(sqlwork.com\)
    Oct 13, 2006
  4. Brian Adkins

    High ActiveRecord CPU Utilization

    Brian Adkins, Mar 7, 2007, in forum: Ruby
    Replies:
    34
    Views:
    414
    M. Edward (Ed) Borasky
    Mar 9, 2007
  5. Jaydeep Chovatia

    futex high system utilization

    Jaydeep Chovatia, Jul 17, 2012, in forum: C++
    Replies:
    4
    Views:
    2,238
    Miquel van Smoorenburg
    Jul 17, 2012
Loading...

Share This Page