Timer interrupt with analogread

In polling strategy, let us monitor the TOV1 flag to see the end of 2 ms period; reload TCNT1 with the Preset Count on the fly, start the ADC, wait until conversion is complete, and then read/save the ADC value.

void loop()
{
  int x[3];
  for (int i = 0; i <= 3; i++)
  {
    while (bitRead(TIFR1, TOV1) != HIGH)
    {
      ; //wait for 2 ms or do something else
    }
    bitSet(TIFR1, TOV1);  //clear  msTOV1 flag
    TCNT1 = 33536;  //reload Preset Count to occur TC1 overflow after 2 ms
    x[i] = analogRead(A0);
  }
}

ok, Can you write the code completed?

It looks like you have a 50Hz sine wave and you want to take samples of it every 2ms.
What is generating this sine wave ? Anyway, its amplitude should be offset from zero because the ADC cannot handle negative voltages.
How many of these groups of 3 samples are you intending to store and how are you going to process these ?

The requirements have to be clear before anyone, including yourself, can start coding.

Oops

int x[3];

void setup()
{
  Serial.begin(9600);

  TCCR1A = 0x00;   //Normal UpCounting Mode
  TCCR1B = 0x00;  //T1 is OFF
  TCNT1 = 0x00;   //Initial Value
  TCCR1B = 0x01;  //TC1 is ON with clkcTC1 = 16 MHz
}

void loop()
{
  for (int i = 0; i <= 2; i++)
  {
    while (bitRead(TIFR1, TOV1) != HIGH)
    {
      ; //wait or do somethimg else
    }
    bitSet(TIFR1, TOV1);  //clear TOV1 flag
    TCNT1 = 33536;
    x[i] = analogRead(A0);
  }
  Serial.print ("Average of 3 random readings: ");
  Serial.println((x[0]+x[1]+x[2])/3, HEX); //average of 3 readings
  delay(2000);   //test interval
}

Quick fix:

int x[3];
for(int i = 0; i<=2; i++)
{
  //code here
}

I have the voltage which is amplitude from 1 V to 4 V and DC offset is 2.5 V and I want 3 samples every 2 ms using timer interrupt and put the three samples in array

sp. "Noob fix"

OK. Interesting exercise. As far as I can understand your original code then you are expecting, by taking any 3 samples, at 2ms apart, of a 50Hz signal, you can calculate the RMS voltage and display it. So, I guess, in this case, you are expecting to see an RMS voltage of 3.06 volts. If you don't get it exactly right, the value displayed will change rapidly.

ok no problem but it will be delay in display
can you write it?

What do you mean?

Which Arduino board have you got ? Some of the ideas appearing here are relevant only for an AVR based board (Arduino Uno etc.). If it is AVR, then directly driving the ADC from a timer and directly accessing the ADC registers, similar to the suggestion by @johnwasser, is the most flexible solution because it appears that you want to do heavy weight calculations on each sample.
You could probably make the calculation easier by detecting the peak voltage and use the formula RMS = peak voltage * 0.707 (but adjusting for the DC offsets ).

I mean you will display the output in LCD so it will delay

Can you read three values in two milliseconds off an LCD?

If not, why have you got an LCD?

Indeed. Most LED driver libraries use blocking code. Some operations like "clear screen" can block for some milliseconds. You have to prepare the value to display in an Interrupt service routine (as already suggested). The display action itself can be done in the loop() and maybe display a fresh value every few seconds.

if not
what is the output display?

@bangora18

Are you planning to digitize the following signal of Fig-1?

sinewaveX
Figure-1:

You need to consider the following points:
1. To repoduce the wave back (approximately), you have to take practically take 500 (10*50) samples over one cycle of the sine wave. Sampling interval would be 50 us.

2. Start the sampling at the zero-crossing point of the wave.

Ok, I want the wave from 1V and 4V, and 2.5V, there is no zero crossing

This will only give you exact 2ms intervals if there are 0 clock cycles between the time the TOV1 flag goes high and the time TCNT1 is set to the preset count. Clearly, that can't be the case.

I agree.