The cost of an action potential