Any good advice for coding to reduce battery usage?

edited March 2014 in General

Just noticed that my processing app tends to be listed as an app using significant energy on the mac (Along with bt backup!, crap programmers)

so, does anyone have any good tips for processing for reducing battery usage?

Answers

  • Answer ✓
    • Use noLoop() & redraw() combo if your sketch only needs to react to user input events.
    • Use a lower frameRate() than 60;
    • Optimize the code within draw() so it ends faster.
  • edited March 2014 Answer ✓

    Anything that finishes faster will use less energy; code that finishes in 0.5 seconds takes more energy than code that finishes in 0.05 seconds.

    Check for something that loops a lot (note that draw() loops a lot unless you specifically tell it not to with noLoop() ).

    There are also hardware-type energy conservation tricks; use dark colours, use quiet or no sounds, don't probe the internet continuously, etc. (if your phone is listing your program as having high energy usage, these are likely not your problem, but still)

Sign In or Register to comment.