Saturday, October 31, 2009

CPU usage. Is it a problem?

This is why I chose to do my start time a little differntly than the way Time Lapse currently waits until a specific time for the purpose of frequency. The screenshots are self-explanitory. I don't really know if the high CPU usage really matters or not. Please give me your opinion. If it is a problem, it would be easy to fix.







You can see the problem in the first few lines of the run method



I wrote my code a little differnly for start time so I could avoid this problem. Should I change my code to be consistant with this? Or should I change this to fix the problem and be consistant with my code? Is this actually a problem?


I think I'll just ignore this for now.

3 comments:

  1. This will drain the XO's battery, thus reducing the amount of learning that can happen with it.

    I recommend using gobject.idle_add() instead of threads.

    ReplyDelete
  2. Thank you for your feedback.
    I agree, this problem should be fixed, but anyone using it to collect the sounds of bees for long periods of time will probably need to have it plugged in, so battery life isn't much of a concern. I plan on fixing this problem sometime this week after Tuesday.

    Thanks for recommending gobject.idle_add(). I had never heard of that, but it looks a lot better than threads for our purposes.

    When I was looking up gobject.idle_add() I came across gobject.timeout_add() which looks like about the same thing except it is only called on a curtain interval, which could be quite useful in this specific case. I will probably end up using gobject.timeout_add() to fix the problem.

    You are the second person I don't know to post on my blog which is great, but it means I should really try to write this blog so people who don't already know what I'm working on it can understand it. Obviously Jeff Elkner, my teacher, and Robin Brooke, the other student in my class, are not the only two people who read my blog. When I get time I'll write a post explaining what I am doing, and what the purpose of this project is

    ReplyDelete
  3. Correction:
    Battery life is a major concern. This program will not be used only to collect the sounds of bees. This program will have many uses. It may often be run when the XO is not plugged in.

    ReplyDelete