I am actually trying to make my own Tachometer will hall sensor. I have attached my code below. It might not be a great coding but still i wish to know why my elapsed time is not coming a finite value. every time the sensor detects the magnet it tells the time but not from zero but from very first time the programme started to run. Though is saw a few tutorials in advance to this and reffered to some of my programming schoolmates none were able to help. So i wish for guidance.