calculate the time and responde