A Theory of the Allocation of Time