On/Off switch

Just began learning the Arduino board.
Hooked up a toggle switch, one leg to 5v pin on board, other leg to GRND. In the up position the board is on, and when down the board turns off. Putting switch back up causes board to start up and begin the program code again.
Did I create an on/off switch for board or just a bogus circuit? New to this stuff and couldn't find anything online about an easy ON/OFF for the actual board, just for LEDs, etc.

one leg to 5v pin on board, other leg to GRND

sounds like your just shorting out your voltage regulator / power supply, this is bad (like smoke n fire bad)

Haha.. that's what I kinda figured, that it was a bogus wire-up. Wanted to have the toggle switch activate a portion of code when flipped on.. was wiring it like the Button - LED basic tutorial and stumbled across this. Do I need to know anything else I'm doing wrong? Thanks!

I'm wiring it following the Basic Button tutorial circuit and it's still killing the board...?

killing it?
Maybe it is already dead

What are the LEDs doing?

It still runs code fine when I disconnect the switch, so the board seems fine still. It's not a pushbutton that I am connecting, but an ON/OFF toggle switch part I had laying around.

Got it working, thanks!