int m;// variable to hold pulses
One letter global variable names are not recommended. How does one associate m with pulse count. Now, pulseCnt or pulseCount would be easy to associate with pulse count.
Along with PeterH's question (which is probably the crux of your problem), I'd ask what the currentMillis variable is for. It is local, so it isn't accessible outside of loop().
Generally, if you want to create a speedometer, you separate the counting of pulses from the sensor from the use of pulse count. That is most easily done by connecting the sensor to pin 2 or 3, and defining an interrupt service routine to be called when the sensor is triggered. That ISR then just counts pulses (in a properly named volatile global variable).
The loop() function then just keeps track of time, and periodically checks how many pulses have occurred, computes the speed, and resets the counter (not necessarily in that order). How often to check depends on what type of counter you are using (byte, int, long) and how long it takes that counter to overflow (you do not want that to ever happen).