you only read the state of the botton once. You need to update your variable in the while loo or ditch the varible altogether
//loop function
void loop(void)
{
const int Button = 16; //GPIO 17
int Button_state = digitalRead(Button);
pinMode(Button, INPUT);//Set Button to be input -- does this need to be in the loop?
if(Button_state == LOW){
timer1 = millis();
timer2 = millis();
while(Button_state == LOW){ // while(digitalRead(Button) == LOW){
Button_state = digitalRead(Button); // added this line. Alternatively, change the while statement as in the comment
timer2 = millis();
}
Hold_time = timer2 - timer1;
passOn(Hold_time);
}
}
Changes tested with Notepad compiler