You cant use pin1 when using Serial(console output, this pin flashes high and low to send data via USB to the computer) as PaulS said, better not use pin2 as well(this is used to recieve signals from the USB), you have other options.
millis() is an Arduino function which "returns" the time for which the current program is running in the Arduino in milliseconds(i.e. it is 0 every time the Arduino resets).
So you can connect 5 switches to 5 digital pins of the Arduino, set them as INPUT and do the following:
IF switch1 is pressed ==> switch1time = millis(), print 0
IF switch2 is pressed ==> switch2time = millis() - switch1time, print switch2time
IF switch3 is pressed ==> switch3time = millis() - switch2time, print switch3time
and so on...
or you can use 1 single switch connected to a single digital pin and using a counter in the program, count the number of presses, and print the respective timings.
To save the data in a text file you will have to add an SD card module(these are pretty cheap) to save the text file in it: https://www.arduino.cc/en/Reference/SD