If you do CTRL+Z, you are not killing the process. You are suspending it and sending it to the background. This probably explains why it does not work the second time you try to run it.
Try stopping the application with CTRL+C.
so i do "iwconfig wlan0 power off" to turn off the wifi power saving, and that gives me an initial ~20ms delay on ping
and after ctr+z i do ps -u root| grep python and kill the python process, and than i do fg <bg task id>
and python code
count = 0
c = Counter()
# inside a python interupt you cannot use 'basic' types so you'll need to use
for j in range(1,100):
for pin in range(7,11):
x = mraa.Gpio(pin)
print('working on pin %d' % (pin, ))
for i in range(1,2):
print('BAD pin %d' % (pin, ))
#x.isr(mraa.EDGE_BOTH, test, test)