while (1) { if (button) { while (button) { timer++; if (timer == 250) { var = 1; } } } if (var) { if (!button) { pushcount++; var = 0; } } }