set counter 0 set counterID -1 label .l -textvariable counter button .b -command startCount -text "Start!" pack .l -fill x pack .b -fill both -expand y proc startCount {} { countUp .b configure -command stopCount -text "Stop!" } proc stopCount {} { global counterID after cancel $counterID .b configure -command startCount -text "Start!" } proc countUp {} { global counterID counter incr counter set counterID [after 1000 countUp] }