Simple one liner to save battery life and reduce system latency

Sometimes I am in an airplane, and I just want to write code and compile it.

Sometimes I am playing a game in full screen, and I don't want it to lag.

Lynoure suggested this simple one-liner which helps immensely, to a point that I have turned it into a habit:

pkill -STOP chromium

When I want to use the browser again:

pkill -CONT chromium

I wish web browsers would stop running anything when unfocused, unless asked otherwise on a site by site basis.

Update: Johannes Schauer blogged more than a year ago about how to automate this in awesome.