Recording switch

Hi guys am in the middle of a project and am facing a big problem

I am using The Sparkfun EL sequencer,xbee and another el sequence and an xbee plugged to my laptop and i want to hook up a switch to one of the channels
and make it an input instead of an output ... so that when the switch is on ... It writes "on" on the computer and starts counting delay(); and when the switch is off ... it writes "off" and counts delat(); also

this is a piece of the code am using
void setup() {
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);

Serial.begin(9600);
}

please help me with the code ASAP

All that code does is set pins as OUTPUTs. It is completely missing the loop() function. There are a number of examples in the tutorials and I believe there is one that comes with the IDE that explain how to read the state of a switch and output that to serial.

I know i already said that this is a piece of the code already existing on the board ...
what i need is to change one of the pins to an input to record a switch on and count delay after on and record off and the delay after off

OK, go ahead and do that.

If I could see the code I could probably help you. But I can't.

Perhaps they can help over at http://snippets-r-us.com/

pinMode(someNumber, INPUT);

and count delay after on and record off and the delay after off

You don't "count delay". You record when an event occurs. When a second event occurs, you can compute the interval between the current event and the previous event.

The millis() function bears investigating.