How to execute a function for "t" time without delay + using external interrupt

8bit_Biker:
The interrupt I would try to set is only for the timed function. I.e.: pushing a key on the keyboard cause the start of a measurement (for a certain and yet set sensor); pushing another button cause the stop of the measurement. During the function I would like Arduino will get values from the sensor and send value to the serial port (simply using Serial.print(....)) using a set time period (for example one serial printing every two second). After every printing Arduino should search the serial port for the "stop key", used as interrupt. I would like to use the sensor data to plot a graph on Processing. Thank you very much!

You don't need interrupts for this. All you need is to set a flag when you detect that the measurement should start, and clear it when it should end. In loop(), use the techniques demonstrated in the 'blink without delay' example sketch to collect your sensor inputs at regular intervals while the flag is set.

I guess that the keyboard you refer to is the keyboard on the host PC. You need to use some application on the host PC to send the keyboard input to the Arduino. If you plan to use the Arduino IDE's serial monitor for this, bear in mind that the serial monitor input is line buffered so you would need to enter your command character(s) followed by the return key to send that command to the Arduino. In other words, two key presses. If you were thinking about using buttons directly connected to the Arduino instead, that would work fine too but you'd need to read (and debounce) the switch states instead of reading commands from the serial port.