n7 Section 337 provides for a four-year limitations for "An action upon any contract, obligation or liability founded upon an instrument in writing, except as provided in Section 336a of this code; provided, that the time within which any action for a money judgment for the balance due upon an obligation for the payment of which a deed of trust or mortgage with power of sale upon real property or any interest therein was given as security, following the exercise of the power of sale in such deed of trust or mortgage, may be brought shall not extend beyond three months after the time of sale under such deed of trust or mortgage."