But still cant stop the timer till i finish
Post your current code. Explain what it actually does. Explain how that differs from what you want it to do.
Before posting your code again, though, put EVERY { on a line BY ITSELF. Put EVERY } on a line BY ITSELF. Use Tools + Auto Format. Life's too short to decipher crappy code, when making properly formatted code is so simple.
while (!digitalWrite,sw){
WTF?
Do you KNOW what the comma operator does? Why is there a function address in the list that the comma operator operates on?