Getting sens value and time it takes for each reading

Im looking at the speedometer codes and they all use sens value in the comments it says it has to be tested according on the distance the leds are placed.. how do i do that ive been desperately looking, i might have stumbled upon in but dont know how to use it as ive been going through all the time libraries. Also how would i get the time it takes for each reading. thanks soo much for your help if you reply and sorry if im posting in the wrong section but i wasnt able to stumble upon this topic anywhere else so i had no idea which section to post in

btw im using a arduino uno r3

What are "the speedometer codes"?

int val;
long last=0;
int stat=LOW;
int stat2;
int contar=0;
int displayrpm;

int sens=75; // this value indicates the limit reading between dark and light,
// it has to be tested as it may change acording on the
// distance the leds are placed.
int nPalas=1; // the number of blades of the propeller

int milisegundos=500; // the time it takes each reading

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
lcd.begin(16,2);
}

void loop()
{
val=analogRead(0);
if(val<sens)
stat=LOW;
else
stat=HIGH;
digitalWrite(13,stat); //as iR light is invisible for us, the led on pin 13
//indicate the state of the circuit.

if(stat2!=stat){ //counts when the state change, thats from (dark to light) or
//from (light to dark), remmember that IR light is invisible for us.
contar++;
stat2=stat;
}
if(millis()-last>=milisegundos){
double rps=((double)contar/nPalas)/2.01000.0/milisegundos;
double rpm=((double)contar/nPalas)/2.0
60000.0/(milisegundos);
displayrpm=rpm;
Serial.print((contar/2.0));Serial.print(" RPS ");Serial.print(rps);
Serial.print(" RPM");Serial.print(rpm);Serial.print(" VAL ");Serial.println(val);
contar=0;
last=millis();
Serial.print(" MPH ");
Serial.print(rpm*0.0080622311);

LCDPrint ();
}
}

void LCDPrint ()
{
lcd.clear ();
lcd.setCursor (0,0);
lcd.print("MPH");
lcd.setCursor (0,1);
lcd.print(displayrpm*0.0080622311 );
lcd.setCursor (8,0);
lcd.print("RPM");
lcd.setCursor (8,1);
lcd.print(displayrpm);

return;
}

its the sens value and milsequendos value i dont understand how to get

What are "the speedometer codes"?

That code does not answer this question.

i mean speedometer codes where people used magnetic switches to count the revolution.. theres a few i found and there all similar.. its those 2 values i mentioned that i dont understand how to get.. the code i posted is basically what ill be using so if someone can explain how this person got those 2 values that would be awesome :)!

painfulfart:
its the sens value and milsequendos value i dont understand how to get

So, reading between the lines "the speedometer codes" is some random code you found on the internet. The best way to get answers about that code is to ask a question to the person who published it. But from a quick scan, I can guess that the sketch uses an optical sensor to detect a moving object and sens represents the threshold used to decide whether the analog input is 'high' (i.e. seeing the light source) or 'low' (i.e. not seeing the light source). Presumably that corresponds to a slotted disc or something like that. milsequendos is how frequently the sketch recalculates the frequency. It works by counting events over a given internal, and the interval is defined by milsequendos.