Question: I have an existing porch light on a (spring-style) timer. I would like to add a switch for more convenience, so that the light could be manually turned on for a few seconds or for several hours.

The function of the 3 way switch would be to turn the light on directly or transfer power to the timer (in series). **Would this be an okay (code compliant) way to add a (simple) switch to a timer?**

Another part of the reason I ask, is because a digital timer (with simple on/off button) is like $30 in my area, whereas a 3 way switch is like $1.50. And the timer just happens to be in a box with an outlet switch that could easily be eliminated (meaning, I don't have to buy a remodel box or anything else).

Edit- New picture for clarity:

[![enter image description here](https://i.stack.imgur.com/tnMUY.jpg)](https://i.stack.imgur.com/tnMUY.jpg)

Answer: 
I looked at your circuit. With the switch in one position it would be on with the switch in the second "timer position" it would only be on until the timer expired. If listed devices in boxes that do not exceede the box fill for wires and devices this would be legal in the U.S.
A three-way switch is not necessary. You can connect a single-pole single-throw in parallel with the spring timer.

[![SPST with timer](https://i.stack.imgur.com/KdQjB.jpg)](https://i.stack.imgur.com/KdQjB.jpg)

EDIT: Future readers should note that this is electrician-safe *only* because both switches are in the same gang box. With the switches in separate boxes, someone working on this circuit in future might be surprised to find voltage on what he thought was a load wire that he had just switched off.

Also note that this is equipment-safe only because a simple mechanical spring timer can tolerate hot voltage on its load terminal. (In fact the spring timer probably does not have "LINE" and "LOAD" labels.)

If anyone ever wants to cobble together a similar setup with a timer that (1) doesn't have an "ON" setting, and (2) may not tolerate hot voltage on its LOAD terminal, then he will need a three-way switch. But it can't be wired according to your proposed circuit. Instead, the timer must be wired between the mains power and the three-way.

[![SPDT with timer](https://i.stack.imgur.com/wCY1l.jpg)](https://i.stack.imgur.com/wCY1l.jpg)

Here the three-way selects between the always-on hot or the timer switched hot. It never feeds power back upstream.