How to time three events

Hi,
I am totally new to Arduino programming. Could someone please explain how to do following.
I want to read the code from ir receiver ( I have figured out this part) and if that code say is A , B or C. I want to record the time when was A, B and C occurred. Then compare these three times and pick the minimum time. Could you please guide me how to perform this?

I want to record the time when was A, B and C occurred.

unsigned long aEventTime, bEventTime, cEventTime;

void loop()
{
   // Get IR code
   if(code == A) // Whatever that means
      aEventTime = millis();
   // Repeat for B and C.

   // Now, determining which event time is greater than 0 but smaller than the other two is easy
}

Hello arifjahangir

Then compare these three times and pick the minimum time.

If you only need the minimum time, that must be the time of the first code received (whichever code that is). So no need to time the other two codes.

Or is there something else you need to do with all three times?

Regards

Ray